Lot of synchronization changes

This commit is contained in:
Dynamitos
2024-06-07 14:56:42 +02:00
parent cb21e8a85a
commit bc0d05dbb0
14 changed files with 686 additions and 515 deletions
+14 -7
View File
@@ -8,15 +8,22 @@ struct VisibilityCullingData
};
ParameterBlock<VisibilityCullingData> pVisibilityParams;
[numthreads(BLOCK_SIZE, BLOCK_SIZE, 1)]
[numthreads(BLOCK_SIZE, 1, 1)]
[shader("compute")]
void computeMain(
uint3 dispatchThreadID: SV_DispatchThreadID,
){
int3 texCoords = int3(dispatchThreadID.xy, 0);
uint encoded = pVisibilityParams.visibilityTexture.Load(texCoords).r;
uint2 decoded = decodePrimitive(encoded);
uint arrIdx = decoded.x / 32;
uint bit = decoded.x % 32;
pVisibilityParams.cullingInfos[decoded.y].visible[arrIdx] |= (1 << bit);
//int3 texCoords = int3(dispatchThreadID.xy, 0);
//uint encoded = pVisibilityParams.visibilityTexture.Load(texCoords).r;
//uint2 decoded = decodePrimitive(encoded);
//uint arrIdx = decoded.x / 32;
//uint bit = decoded.x % 32;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[0] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[1] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[2] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[3] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[4] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[5] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[6] = 0x0;
pVisibilityParams.cullingInfos[dispatchThreadID.x].visible[7] = 0x0;
}