diff options
Diffstat (limited to 'indra/newview/pipeline.cpp')
| -rw-r--r-- | indra/newview/pipeline.cpp | 77 |
1 files changed, 46 insertions, 31 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9b104f363a..bc1a105e44 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -122,16 +122,27 @@ #include "SMAAAreaTex.h" #include "SMAASearchTex.h" #include "llerror.h" -#ifndef LL_WINDOWS -#define A_GCC 1 + +#if LL_CLANG +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +#pragma clang diagnostic ignored "-Wunused-variable" +#elif LL_GNUC +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-variable" -#if LL_LINUX #pragma GCC diagnostic ignored "-Wrestrict" #endif +#ifndef LL_WINDOWS +#define A_GCC 1 #endif #define A_CPU 1 #include "app_settings/shaders/class1/deferred/CASF.glsl" // This is also C++ +#if LL_CLANG +#pragma clang diagnostic pop +#elif LL_GNUC +#pragma GCC diagnostic pop +#endif extern bool gSnapshot; bool gShiftFrame = false; @@ -628,6 +639,16 @@ void LLPipeline::init() LLFontWidthBuffer::enableBufferCollection(enable_buffers); }); } + + cntrl_ptr = gSavedSettings.getControl("CollectUIImageVertexBuffers"); + if (cntrl_ptr.notNull()) + { + cntrl_ptr->getCommitSignal()->connect([](LLControlVariable* control, const LLSD& value, const LLSD& previous) + { + bool enable_buffers = control->getValue().asBoolean(); + LLUIImage::enableDisplayListsCollection(enable_buffers); + }); + } } LLPipeline::~LLPipeline() @@ -834,9 +855,8 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; - - static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true); - bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr(); + bool has_hdr = gSavedSettings.getBOOL("RenderHDREnabled"); + bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr; static LLCachedControl<U32> MPColorPrecision(gSavedSettings, "MPColorPrecision", 0); @@ -910,12 +930,11 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) if (!gCubeSnapshot) // hack to not re-allocate various targets for cube snapshots { - GLuint UIFormat = GL_RGBA8; - //if(mHDRDisplay && MPColorPrecision == 2) UIFormat = GL_RGBA16F; + U32 post_color_fmt = gSavedSettings.getBOOL("RenderHighPrecisionPostProcess") ? GL_RGBA16F : GL_RGBA8; if (RenderUIBuffer) { - if (!mUIScreen.allocate(resX, resY, UIFormat)) + if (!mUIScreen.allocate(resX, resY, GL_RGBA8)) { return false; } @@ -923,16 +942,15 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) if (RenderFSAAType > 0) { - GLuint AAFormat = GL_RGBA8; if(mHDRDisplay && MPColorPrecision != 1) { - AAFormat = GL_RGBA16F; + post_color_fmt = GL_RGBA16F; } - if (!mFXAAMap.allocate(resX, resY, AAFormat)) return false; + if (!mFXAAMap.allocate(resX, resY, post_color_fmt)) return false; if (RenderFSAAType == 2) { - if (!mSMAABlendBuffer.allocate(resX, resY, AAFormat, false)) return false; + if (!mSMAABlendBuffer.allocate(resX, resY, post_color_fmt, false)) return false; } } else @@ -957,10 +975,6 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) mSceneMap.release(); } -/* - mPostPingMap.allocate(resX, resY, GL_RGBA); - mPostPongMap.allocate(resX, resY, GL_RGBA); -*/ if((hdr && MPColorPrecision == 2) || mHDRDisplay) { mPostMaps[0].allocate(resX, resY, screenFormat); @@ -968,8 +982,8 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) } else { - mPostMaps[0].allocate(resX, resY, GL_RGBA); - mPostMaps[1].allocate(resX, resY, GL_RGBA); + mPostMaps[0].allocate(resX, resY, post_color_fmt); + mPostMaps[1].allocate(resX, resY, post_color_fmt); } // The water exclusion mask needs its own depth buffer so we can take care of the problem of multiple water planes. @@ -1210,6 +1224,8 @@ void LLPipeline::refreshCachedSettings() bool enable_buffers = gSavedSettings.getBOOL("CollectFontVertexBuffers"); LLFontVertexBuffer::enableBufferCollection(enable_buffers); LLFontWidthBuffer::enableBufferCollection(enable_buffers); + enable_buffers = gSavedSettings.getBOOL("CollectUIImageVertexBuffers"); + LLUIImage::enableDisplayListsCollection(enable_buffers); } void LLPipeline::releaseGLBuffers() @@ -4524,7 +4540,7 @@ void LLPipeline::renderPhysicsDisplay() LLGLEnable polygon_offset_line(GL_POLYGON_OFFSET_LINE); glPolygonOffset(3.f, 3.f); - //glLineWidth(3.f); + //gGL.setLineWidth(3.f); LLGLEnable blend(GL_BLEND); gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -4566,7 +4582,7 @@ void LLPipeline::renderPhysicsDisplay() glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } } - //glLineWidth(1.f); + //gGL.setLineWidth(1.f); gDebugProgram.unbind(); } @@ -4650,8 +4666,7 @@ void LLPipeline::renderDebug() //NavMesh if ( pathfindingConsole->isRenderNavMesh() ) { - gGL.flush(); - //glLineWidth(2.0f); + //gGL.setLineWidth(2.0f); LLGLEnable cull(GL_CULL_FACE); LLGLDisable blend(GL_BLEND); @@ -4675,7 +4690,7 @@ void LLPipeline::renderDebug() gGL.flush(); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); - //glLineWidth(1.0f); + //gGL.setLineWidth(1.0f); gGL.flush(); } //User designated path @@ -4790,11 +4805,11 @@ void LLPipeline::renderDebug() gPathfindingProgram.uniform1f(sTint, 1.f); gPathfindingProgram.uniform1f(sAlphaScale, 1.f); - //glLineWidth(gSavedSettings.getF32("PathfindingLineWidth")); + //gGL.setLineWidth(gSavedSettings.getF32("PathfindingLineWidth")); LLGLDisable blendOut(GL_BLEND); llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] ); gGL.flush(); - //glLineWidth(1.f); + //gGL.setLineWidth(1.f); } glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); @@ -4817,7 +4832,7 @@ void LLPipeline::renderDebug() LLGLEnable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER); gGL.flush(); - //glLineWidth(2.0f); + //gGL.setLineWidth(2.0f); LLGLEnable cull(GL_CULL_FACE); gPathfindingProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint")); @@ -4844,7 +4859,7 @@ void LLPipeline::renderDebug() gPathfindingProgram.bind(); gGL.flush(); - //glLineWidth(1.0f); + //gGL.setLineWidth(1.0f); } glPolygonOffset(0.f, 0.f); @@ -5136,7 +5151,7 @@ void LLPipeline::renderDebug() } /*gGL.flush(); - glLineWidth(16-i*2); + gGL.setLineWidth(16-i*2); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -5154,7 +5169,7 @@ void LLPipeline::renderDebug() } } gGL.flush(); - glLineWidth(1.f);*/ + gGL.setLineWidth(1.f);*/ } } @@ -9812,7 +9827,7 @@ void LLPipeline::bindReflectionProbes(LLGLSLShader& shader) void LLPipeline::unbindReflectionProbes(LLGLSLShader& shader) { - S32 channel = shader.disableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP); + S32 channel = shader.disableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); if (channel > -1 && mReflectionMapManager.mTexture.notNull()) { mReflectionMapManager.mTexture->unbind(); |
