diff options
author | Dave Parks <davep@lindenlab.com> | 2022-05-19 22:36:03 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-05-19 22:36:03 -0500 |
commit | 096ad1306d1a5db300592d9be87ab6762777d400 (patch) | |
tree | 2d37acd86c9176cb1a8a423159200a6e28ea4b1d /indra/newview/llreflectionmapmanager.cpp | |
parent | 3564b24e2a90e0772c37185cc5dcedca29d62ab8 (diff) |
SL-17286 Only update reflection probe UBO once per pipe flush
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 5fe510fb56..fb98a2a6d4 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -502,12 +502,10 @@ void LLReflectionMapManager::updateNeighbors(LLReflectionMap* probe) } } -void LLReflectionMapManager::setUniforms() +void LLReflectionMapManager::updateUniforms() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; - // TODO -- avoid repacking UBO unnecessarily - // structure for packing uniform buffer object // see class2/deferred/softenLightF.glsl struct ReflectionProbeData @@ -578,7 +576,7 @@ void LLReflectionMapManager::setUniforms() { // out of space break; } - + GLint idx = neighbor->mProbeIndex; if (idx == -1) { @@ -589,7 +587,7 @@ void LLReflectionMapManager::setUniforms() rpd.refNeighbor[ni++] = idx; } } - + if (nc == ni) { //no neighbors, tag as empty @@ -606,8 +604,8 @@ void LLReflectionMapManager::setUniforms() nc += 4 - (nc % 4); } } - - + + count++; } @@ -625,7 +623,14 @@ void LLReflectionMapManager::setUniforms() glBufferDataARB(GL_UNIFORM_BUFFER, sizeof(ReflectionProbeData), &rpd, GL_STREAM_DRAW); glBindBufferARB(GL_UNIFORM_BUFFER, 0); } +} +void LLReflectionMapManager::setUniforms() +{ + if (mUBO == 0) + { + updateUniforms(); + } glBindBufferBase(GL_UNIFORM_BUFFER, 1, mUBO); } |