Browse Source

Fix a bug in AMD

Panagiotis Christopoulos Charitos 11 months ago
parent
commit
317f608572
1 changed files with 2 additions and 2 deletions
  1. 2 2
      AnKi/Shaders/ClusterBinning.ankiprog

+ 2 - 2
AnKi/Shaders/ClusterBinning.ankiprog

@@ -47,7 +47,7 @@ constexpr U32 kPackVisiblesThreadgroupSize = 64;
 		// First threads set the dispatch args of cluster binning
 
 		const GpuSceneNonRenderableObjectType type = (GpuSceneNonRenderableObjectType)svDispatchThreadId;
-		const U32 objCount = min(kMaxVisibleClusteredObjects[(U32)type], g_visibleIndices[(U32)type][0]);
+		const U32 objCount = min(kMaxVisibleClusteredObjects[(U32)type], g_visibleIndices[NonUniformResourceIndex((U32)type)][0]);
 
 		DispatchIndirectArgs args;
 		args.m_threadGroupCountX = (g_consts.m_tileCount * kSampleCount + kClusterBinningThreadgroupSize - 1) / kClusterBinningThreadgroupSize;
@@ -62,7 +62,7 @@ constexpr U32 kPackVisiblesThreadgroupSize = 64;
 
 		const GpuSceneNonRenderableObjectType type =
 			(GpuSceneNonRenderableObjectType)(svDispatchThreadId - (U32)GpuSceneNonRenderableObjectType::kCount);
-		const U32 objCount = min(kMaxVisibleClusteredObjects[(U32)type], g_visibleIndices[(U32)type][0]);
+		const U32 objCount = min(kMaxVisibleClusteredObjects[(U32)type], g_visibleIndices[NonUniformResourceIndex((U32)type)][0]);
 
 		DispatchIndirectArgs args;
 		args.m_threadGroupCountX = (objCount + kPackVisiblesThreadgroupSize - 1) / kPackVisiblesThreadgroupSize;