From b4c4fa785c03c2d4ba2a1d28d94394c7ca000358 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sat, 16 Jun 2018 12:54:45 -0300 Subject: [PATCH] Bugfix: Added submitted patch. Area lights are not guaranteed to be in order sequentually when light lists are built multithreaded, thus it was causing asserts when Approx Area lights were present. --- Components/Hlms/Pbs/src/OgreHlmsPbs.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp b/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp index 85addbdc00f..063a2542628 100644 --- a/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp +++ b/Components/Hlms/Pbs/src/OgreHlmsPbs.cpp @@ -1511,11 +1511,15 @@ namespace Ogre mAreaLights.reserve( numAreaApproxLights ); mAreaLights.clear(); const LightListInfo &globalLightList = sceneManager->getGlobalLightList(); - for( size_t i=0; igetType() == Light::LT_AREA_APPROX ); - mAreaLights.push_back( globalLightList.lights[idx] ); + size_t areaLightNumber = 0; + for( size_t idx = mAreaLightsGlobalLightListStart; + idxgetType() == Light::LT_AREA_APPROX ) + { + mAreaLights.push_back( globalLightList.lights[idx] ); + areaLightNumber++; + } } std::sort( mAreaLights.begin(), mAreaLights.end(), SortByTextureLightMaskIdx );