Lots of shader changes, basic primitive writing
This commit is contained in:
@@ -7,25 +7,31 @@ groupshared uint head;
|
||||
[numthreads(TASK_GROUP_SIZE, 1, 1)]
|
||||
[shader("amplification")]
|
||||
void taskMain(
|
||||
uint threadID: SV_GroupIndex,
|
||||
uint groupID: SV_GroupID,
|
||||
){
|
||||
InstanceData instance = pScene.instances[pOffsets.instanceOffset + groupID];
|
||||
MeshData mesh = pScene.meshData[pOffsets.instanceOffset + groupID];
|
||||
//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);
|
||||
uint threadID: SV_GroupIndex,
|
||||
uint groupID: SV_GroupID, )
|
||||
{
|
||||
MeshData mesh = pScene.meshData[pOffsets.instanceOffset + groupID];
|
||||
if (threadID == 0)
|
||||
{
|
||||
head = 0;
|
||||
p.instanceId = pOffsets.instanceOffset + groupID;
|
||||
p.meshletOffset = mesh.meshletOffset;
|
||||
p.cullingOffset = pScene.cullingOffsets[p.instanceId];
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
for (uint i = threadID; i < mesh.numMeshlets; i += TASK_GROUP_SIZE)
|
||||
{
|
||||
uint m = p.meshletOffset + i;
|
||||
uint cull = p.cullingOffset + i;
|
||||
MeshletDescription meshlet = pScene.meshletInfos[m];
|
||||
MeshletCullingInfo culling = pScene.culledMeshlets[cull];
|
||||
if(false)
|
||||
{
|
||||
uint index;
|
||||
InterlockedAdd(head, 1, index);
|
||||
p.culledMeshlets[index] = i;
|
||||
}
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DispatchMesh(head, 1, 1, p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user