2024-05-16 19:47:35 +02:00
|
|
|
import Common;
|
|
|
|
|
import Scene;
|
|
|
|
|
|
|
|
|
|
groupshared MeshPayload p;
|
|
|
|
|
groupshared uint head;
|
|
|
|
|
|
|
|
|
|
[numthreads(TASK_GROUP_SIZE, 1, 1)]
|
|
|
|
|
[shader("amplification")]
|
|
|
|
|
void taskMain(
|
|
|
|
|
uint threadID: SV_GroupIndex,
|
2024-05-30 16:56:22 +02:00
|
|
|
uint groupID: SV_GroupID,
|
2024-05-16 19:47:35 +02:00
|
|
|
){
|
|
|
|
|
InstanceData instance = pScene.instances[pOffsets.instanceOffset + groupID];
|
|
|
|
|
MeshData mesh = pScene.meshData[pOffsets.instanceOffset + groupID];
|
2024-05-30 16:56:22 +02:00
|
|
|
//head = 0;
|
|
|
|
|
//GroupMemoryBarrierWithGroupSync();
|
|
|
|
|
//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[instance.meshletCullingOffset];
|
|
|
|
|
// if(culling.anyVisible())
|
|
|
|
|
// {
|
|
|
|
|
// uint index;
|
|
|
|
|
// InterlockedAdd(head, 1, index);
|
|
|
|
|
// p.culledMeshlets[index] = m;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//GroupMemoryBarrierWithGroupSync();
|
|
|
|
|
//DispatchMesh(head, 1, 1, p);
|
|
|
|
|
}
|