@@ -199,21 +199,21 @@ void REPROJECT_GLOBAL_ILLUMINATION(uint3 dispatchThreadId : SV_DispatchThreadID,
199199 UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z);
200200
201201 // Compute the pixel position to process
202- uint2 currentCoord = groupId * INDIRECT_DIFFUSE_TILE_SIZE + groupThreadId ;
203-
202+ uint2 inputCoord = dispatchThreadId.xy ;
203+ uint2 currentCoord = dispatchThreadId.xy;
204204#if HALF_RES
205205 // Compute the full resolution pixel for the inputs that do not have a pyramid
206- currentCoord = currentCoord * 2;
206+ inputCoord = inputCoord * 2;
207207#endif
208208
209209 // Read the depth and compute the position
210- float deviceDepth = LOAD_TEXTURE2D_X(_DepthTexture, currentCoord ).x;
211- uint2 tileIndex = uint2(currentCoord ) / GetTileSize();
212- PositionInputs posInput = GetPositionInput(currentCoord , _ScreenSize.zw, deviceDepth, UNITY_MATRIX_I_VP, GetWorldToViewMatrix(), tileIndex);
210+ float deviceDepth = LOAD_TEXTURE2D_X(_DepthTexture, inputCoord ).x;
211+ uint2 tileIndex = uint2(inputCoord ) / GetTileSize();
212+ PositionInputs posInput = GetPositionInput(inputCoord , _ScreenSize.zw, deviceDepth, UNITY_MATRIX_I_VP, GetWorldToViewMatrix(), tileIndex);
213213
214214 // Read the pixel normal
215215 NormalData normalData;
216- DecodeFromNormalBuffer(currentCoord .xy, normalData);
216+ DecodeFromNormalBuffer(inputCoord .xy, normalData);
217217
218218 // Generete a new direction to follow
219219 float2 newSample;
@@ -308,5 +308,5 @@ void REPROJECT_GLOBAL_ILLUMINATION(uint3 dispatchThreadId : SV_DispatchThreadID,
308308 color = HsvToRgb(color);
309309
310310 // Write the output to the target pixel
311- _IndirectDiffuseTextureRW[COORD_TEXTURE2D_X(dispatchThreadId.xy )] = color;
311+ _IndirectDiffuseTextureRW[COORD_TEXTURE2D_X(currentCoord )] = color;
312312}
0 commit comments