Fatal error C9999: unexpected expression in DUI_foreachId

I am getting this error in a compute shader and I have no clue what this means, I have this code


void main()
{
	ivec2 Coordinate = ivec2(gl_GlobalInvocationID.xy);

	vec3 LightDirection = vec3(0.0, -1.0, 0.0);

    RayPayload Payload = DispatchShadowRay(Coordinate, LightDirection);
    float ShadowVal = 0.0;


    if(!Payload.InLight)
        ShadowVal = 0.5;
    
   imageStore(ShadowBuffer, Coordinate, vec4(ShadowVal));

}

this code works fine but if I introduce another DispatchShadowRay Function

RayPayload Payload = DispatchShadowRay(Coordinate, LightDirection);
RayPayload Payload2 = DispatchShadowRay(Coordinate, LightDirection);

as an example I get the error fatal error C9999: unexpected expression in DUI_foreachId. I did some googling and couldn’t seem to find an error for that this actually means. I think its talking about the global invocation ID but I don’t understand why introducing extra code/function like that can cause this.

Edit: On my AMD integrated graphics it works but on my dedicated NVidia gpu it doesn’t work. I updated the drivers on my dedicated GPU and it still isn’t working.

Interesting.

A few websearch hits: