Sfoglia il codice sorgente

Minor visualization

Panagiotis Christopoulos Charitos 1 anno fa
parent
commit
b75ad68596
1 ha cambiato i file con 14 aggiunte e 1 eliminazioni
  1. 14 1
      AnKi/Shaders/GBufferGeneric.ankiprog

+ 14 - 1
AnKi/Shaders/GBufferGeneric.ankiprog

@@ -113,6 +113,10 @@ struct VertOut
 	RVec3 m_normal : NORMAL;
 #endif
 
+#if VISUALIZE_MESHLETS
+	nointerpolation U32 m_meshletIndex : MESHLET_INDEX;
+#endif
+
 	nointerpolation U32 m_constantsOffset : UNIS_OFFSET;
 };
 
@@ -260,6 +264,11 @@ VertOut main(VertIn input)
 	const U32 constantsOffset = instance.m_constantsOffset;
 	const U32 worldTransformsOffset = instance.m_worldTransformsOffset_25bit_meshletPrimitiveCount_7bit >> 7u;
 	const U32 boneTransformsOrParticleEmitterOffset = instance.m_boneTransformsOrParticleEmitterOffset;
+
+#		if VISUALIZE_MESHLETS
+	output.m_meshletIndex = instance.m_meshletGeometryDescriptorIndex;
+#		endif
+
 #	else
 	const GpuSceneRenderableInstance instance = unpackGpuSceneRenderableVertex(input.m_instanceData);
 	const GpuSceneMeshLod mesh = g_meshLods[instance.m_meshLodIndex];
@@ -655,8 +664,12 @@ FragOut main(
 	g.m_metallic = metallic;
 	g.m_velocity = velocity;
 
-#		if VISUALIZE_MESHLETS && ANKI_TECHNIQUE_GBufferMeshShaders
+#		if VISUALIZE_MESHLETS && (ANKI_TECHNIQUE_GBufferMeshShaders || ANKI_TECHNIQUE_GBufferSwMeshletRendering)
+#			if ANKI_TECHNIQUE_GBufferMeshShaders
 	const U32 meshletIdx = primInput.m_meshletIndex % 6u;
+#			else
+	const U32 meshletIdx = vertInput.m_meshletIndex % 6u;
+#			endif
 	switch(meshletIdx)
 	{
 	case 0: