Changing vertex data interfaces

This commit is contained in:
Dynamitos
2024-06-25 08:59:09 +02:00
parent bd63b14260
commit c352555b0b
11 changed files with 131 additions and 158 deletions
+2 -18
View File
@@ -51,32 +51,16 @@ void reduceLevel(
setDstDepth(minCoords / 2, minDepth);
}
groupshared uint uMinDepth;
[numthreads(BLOCK_SIZE, BLOCK_SIZE, 1)]
[shader("compute")]
void initialReduce(
uint3 threadID: SV_GroupThreadID,
uint3 groupID: SV_GroupID,
) {
uint reducedWidth = uint(pViewParams.screenDimensions.x) / BLOCK_SIZE;
uint width = uint(pViewParams.screenDimensions.x);
int2 groupOffset = groupID.xy * BLOCK_SIZE;
int2 texCoord = groupOffset + threadID.xy;
float fDepth = pDepthAttachment.texture.Load(int3(texCoord, 0)).r;
uint uDepth = asuint(fDepth);
if(groupID.x == 0 && groupID.y == 0)
{
uMinDepth = 0xffffffff;
}
GroupMemoryBarrierWithGroupSync();
InterlockedMin(uMinDepth, uDepth);
pDepthAttachment.buffer[texCoord.x + (texCoord.y * width)] = fDepth;
GroupMemoryBarrierWithGroupSync();
float fMinDepth = asfloat(uMinDepth);
if(threadID.x == 0 && threadID.y == 0)
{
pDepthAttachment.buffer[groupID.x + (groupID.y * reducedWidth)] = fMinDepth;
}
}