diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-01-18 13:15:32 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-01-18 13:15:32 -0500 |
commit | fea1d9f4d21ceccb6ebb13270c40ebbae737e769 (patch) | |
tree | c6e4fa3a9c1f0ff39e3a65e4694b3bb891d2812e /indra/newview/llvosky.cpp | |
parent | 5fa7f69101a889009194eeddb927599d7536613f (diff) | |
parent | fe796dac711c7ecdc7d6d17e0b692abf468b754a (diff) |
SL-20546: Merge branch 'DRTVWR-588-maint-W' into sl-20546.
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r-- | indra/newview/llvosky.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index cb2f8b6e18..20621665fa 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -531,7 +531,7 @@ void LLVOSky::initCubeMap() images.push_back(mShinyTex[side].getImageRaw()); } - if (!mCubeMap && gSavedSettings.getBOOL("RenderWater") && gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps) + if (!mCubeMap && gSavedSettings.getBOOL("RenderWater") && LLCubeMap::sUseCubeMaps) { mCubeMap = new LLCubeMap(false); } @@ -576,7 +576,7 @@ void LLVOSky::restoreGL() updateDirections(psky); - if (gSavedSettings.getBOOL("RenderWater") && gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps) + if (gSavedSettings.getBOOL("RenderWater") && LLCubeMap::sUseCubeMaps) { initCubeMap(); } @@ -585,7 +585,7 @@ void LLVOSky::restoreGL() if (mDrawable) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); } } @@ -692,7 +692,7 @@ bool LLVOSky::updateSky() LLHeavenBody::setInterpVal( mInterpVal ); updateDirections(psky); - if (!mCubeMap) + if (!mCubeMap || LLPipeline::sReflectionProbesEnabled) { mCubeMapUpdateStage = NUM_CUBEMAP_FACES; mForceUpdate = FALSE; @@ -715,7 +715,7 @@ bool LLVOSky::updateSky() mForceUpdate = FALSE; } } - else if (mCubeMapUpdateStage == NUM_CUBEMAP_FACES) + else if (mCubeMapUpdateStage == NUM_CUBEMAP_FACES && !LLPipeline::sReflectionProbesEnabled) { LL_PROFILE_ZONE_NAMED("updateSky - forced"); LLSkyTex::stepCurrent(); @@ -767,19 +767,15 @@ bool LLVOSky::updateSky() mForceUpdate = FALSE; mForceUpdateThrottle.setTimerExpirySec(UPDATE_EXPRY); - if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_GROUND)) - { - gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE); - } if (mDrawable.notNull() && mDrawable->getFace(0) && !mDrawable->getFace(0)->getVertexBuffer()) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); } mCubeMapUpdateStage = -1; } // run 0 to 5 faces, each face in own frame - else if (mCubeMapUpdateStage >= 0 && mCubeMapUpdateStage < NUM_CUBEMAP_FACES) + else if (mCubeMapUpdateStage >= 0 && mCubeMapUpdateStage < NUM_CUBEMAP_FACES && !LLPipeline::sReflectionProbesEnabled) { LL_PROFILE_ZONE_NAMED("updateSky - create"); S32 side = mCubeMapUpdateStage; @@ -1013,8 +1009,8 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable) face->setSize(4, 6); face->setGeomIndex(0); face->setIndicesIndex(0); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); - buff->allocateBuffer(4, 6, TRUE); + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK); + buff->allocateBuffer(4, 6); face->setVertexBuffer(buff); index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp); @@ -1049,7 +1045,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable) *indicesp++ = index_offset + 3; *indicesp++ = index_offset + 2; - buff->flush(); + buff->unmapBuffer(); } } @@ -1142,8 +1138,8 @@ bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const if (!facep->getVertexBuffer()) { facep->setSize(4, 6); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); - if (!buff->allocateBuffer(facep->getGeomCount(), facep->getIndicesCount(), TRUE)) + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK); + if (!buff->allocateBuffer(facep->getGeomCount(), facep->getIndicesCount())) { LL_WARNS() << "Failed to allocate Vertex Buffer for vosky to " << facep->getGeomCount() << " vertices and " @@ -1182,7 +1178,7 @@ bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const *indicesp++ = index_offset + 2; *indicesp++ = index_offset + 3; - facep->getVertexBuffer()->flush(); + facep->getVertexBuffer()->unmapBuffer(); return TRUE; } @@ -1382,8 +1378,8 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, if (!face->getVertexBuffer() || quads*4 != face->getGeomCount()) { face->setSize(quads * 4, quads * 6); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); - if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE)) + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK); + if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount())) { LL_WARNS() << "Failed to allocate Vertex Buffer for vosky to " << face->getGeomCount() << " vertices and " @@ -1526,7 +1522,7 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, } } - face->getVertexBuffer()->flush(); + face->getVertexBuffer()->unmapBuffer(); } } |