Browse Source

Fix more bugs

Panagiotis Christopoulos Charitos 2 years ago
parent
commit
a0df43ea99
2 changed files with 6 additions and 1 deletions
  1. 1 1
      AnKi/Renderer/ShadowMapping.cpp
  2. 5 0
      AnKi/Scene/Components/LightComponent.h

+ 1 - 1
AnKi/Renderer/ShadowMapping.cpp

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

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

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