Răsfoiți Sursa

Minor fixes in the previous commit

Panagiotis Christopoulos Charitos 2 ani în urmă
părinte
comite
921ea35063

+ 2 - 0
AnKi/Renderer/GpuVisibility.cpp

@@ -54,10 +54,12 @@ Error GpuVisibility::init()
 		m_grProgs[i].reset(&variant->getProgram());
 	}
 
+#if ANKI_STATS_ENABLED
 	for(GpuReadbackMemoryAllocation& alloc : m_readbackMemory)
 	{
 		alloc = GpuReadbackMemoryPool::getSingleton().allocate(sizeof(U32));
 	}
+#endif
 
 	return Error::kNone;
 }

+ 5 - 1
AnKi/Shaders/GpuVisibility.ankiprog

@@ -184,7 +184,11 @@
 
 	// Now update the stats
 #if STATS
-	InterlockedAdd(g_testsPassed[0], 1);
+	const U32 activeLanes = WaveActiveCountBits(true);
+	if(WaveIsFirstLane())
+	{
+		InterlockedAdd(g_testsPassed[0], activeLanes);
+	}
 #endif
 }
 

+ 2 - 0
AnKi/Shaders/Intellisense.hlsl

@@ -164,3 +164,5 @@ template<typename T>
 T WaveActiveMax(T value);
 
 bool WaveIsFirstLane();
+
+unsigned WaveActiveCountBits(bool bit);