Adding cached depth renderpass

This commit is contained in:
Dynamitos
2024-05-30 16:56:22 +02:00
parent 4b6022237b
commit f278afad66
20 changed files with 908 additions and 677 deletions
+34
View File
@@ -0,0 +1,34 @@
import Common;
import Scene;
groupshared MeshPayload p;
groupshared uint head;
[numthreads(TASK_GROUP_SIZE, 1, 1)]
[shader("amplification")]
void taskMain(
uint threadID: SV_GroupIndex,
uint groupID: SV_GroupID, )
{
if (threadID == 0)
{
head = 0;
p.instanceId = pOffsets.instanceOffset + groupID;
}
GroupMemoryBarrierWithGroupSync();
MeshData mesh = pScene.meshData[p.instanceId];
for (uint i = threadID; i < mesh.numMeshlets; i += TASK_GROUP_SIZE)
{
uint m = mesh.meshletOffset + i;
//MeshletDescription meshlet = pScene.meshletInfos[m];
//MeshletCullingInfo culling = pScene.culledMeshlets[pScene.cullingOffsets[p.instanceId] + i];
//if(culling.anyVisible())
{
uint index;
InterlockedAdd(head, 1, index);
p.culledMeshlets[i] = m;
}
}
GroupMemoryBarrierWithGroupSync();
DispatchMesh(mesh.numMeshlets, 1, 1, p);
}