Panagiotis Christopoulos Charitos 2 anni fa
parent
commit
a0df43ea99

+ 1 - 1
AnKi/Renderer/ShadowMapping.cpp

@@ -635,7 +635,7 @@ BufferOffsetRange ShadowMapping::vetVisibilityPass(CString passName, const Light
 
 		cmdb.bindShaderProgram(m_vetVisibilityGrProg.get());
 
-		const UVec4 lightIndex(lightc.getArrayIndex());
+		const UVec4 lightIndex(lightc.getGpuSceneLightAllocation().getIndex());
 		cmdb.setPushConstants(&lightIndex, sizeof(lightIndex));
 
 		cmdb.bindStorageBuffer(0, 0, hashBuff);

+ 5 - 0
AnKi/Scene/Components/LightComponent.h

@@ -151,6 +151,11 @@ public:
 
 	ANKI_INTERNAL void setShadowAtlasUvViewports(ConstWeakArray<Vec4> viewports);
 
+	const GpuSceneArrays::Light::Allocation& getGpuSceneLightAllocation() const
+	{
+		return m_gpuSceneLight;
+	}
+
 private:
 	Vec4 m_diffColor = Vec4(0.5f);
 	Transform m_worldTransform = Transform::getIdentity();