Working on visibility pass

This commit is contained in:
Dynamitos
2024-06-07 09:19:47 +02:00
parent ad00e16cf9
commit cb21e8a85a
24 changed files with 450 additions and 373 deletions
+5 -4
View File
@@ -3,17 +3,18 @@ import Scene;
groupshared MeshPayload p;
groupshared uint head;
groupshared MeshData mesh;
[numthreads(TASK_GROUP_SIZE, 1, 1)]
[shader("amplification")]
void taskMain(
uint threadID: SV_GroupIndex,
uint threadID: SV_GroupThreadID,
uint groupID: SV_GroupID, )
{
MeshData mesh = pScene.meshData[pOffsets.instanceOffset + groupID];
if (threadID == 0)
{
head = 0;
mesh = pScene.meshData[pOffsets.instanceOffset + groupID];
p.instanceId = pOffsets.instanceOffset + groupID;
p.meshletOffset = mesh.meshletOffset;
p.cullingOffset = pScene.cullingOffsets[p.instanceId];
@@ -24,8 +25,8 @@ void taskMain(
uint m = p.meshletOffset + i;
uint cull = p.cullingOffset + i;
MeshletDescription meshlet = pScene.meshletInfos[m];
MeshletCullingInfo culling = pScene.culledMeshlets[cull];
if(false)
MeshletCullingInfo culling = pScene.cullingInfos[cull];
//if(!culling.anyVisible())
{
uint index;
InterlockedAdd(head, 1, index);