diff options
Diffstat (limited to 'indra/newview/pipeline.cpp')
| -rw-r--r-- | indra/newview/pipeline.cpp | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 54fa7a2c09..ab7058b5df 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; @@ -821,9 +832,8 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) { 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; if (mRT == &mMainRT) { // hacky -- allocate auxillary buffer @@ -889,6 +899,8 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) if (!gCubeSnapshot) // hack to not re-allocate various targets for cube snapshots { + U32 post_color_fmt = gSavedSettings.getBOOL("RenderHighPrecisionPostProcess") ? GL_RGBA16F : GL_RGBA; + if (RenderUIBuffer) { if (!mUIScreen.allocate(resX, resY, GL_RGBA)) @@ -899,10 +911,10 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) if (RenderFSAAType > 0) { - if (!mFXAAMap.allocate(resX, resY, GL_RGBA)) return false; + if (!mFXAAMap.allocate(resX, resY, post_color_fmt)) return false; if (RenderFSAAType == 2) { - if (!mSMAABlendBuffer.allocate(resX, resY, GL_RGBA, false)) return false; + if (!mSMAABlendBuffer.allocate(resX, resY, post_color_fmt, false)) return false; } } else @@ -923,8 +935,8 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) mSceneMap.release(); } - mPostPingMap.allocate(resX, resY, GL_RGBA); - mPostPongMap.allocate(resX, resY, GL_RGBA); + mPostPingMap.allocate(resX, resY, post_color_fmt); + mPostPongMap.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. // Should we ever make water not just a plane, it also aids with that as well as the water planes will be rendered into the mask. @@ -1020,7 +1032,7 @@ bool LLPipeline::allocateShadowBuffer(U32 resX, U32 resY) gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_ANISOTROPIC); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); } } @@ -1037,7 +1049,7 @@ bool LLPipeline::allocateShadowBuffer(U32 resX, U32 resY) gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_ANISOTROPIC); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); } } @@ -4365,7 +4377,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); @@ -4407,7 +4419,7 @@ void LLPipeline::renderPhysicsDisplay() glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } } - glLineWidth(1.f); + gGL.setLineWidth(1.f); gDebugProgram.unbind(); } @@ -4491,8 +4503,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); @@ -4516,7 +4527,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 @@ -4631,11 +4642,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 ); @@ -4658,7 +4669,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")); @@ -4685,7 +4696,7 @@ void LLPipeline::renderDebug() gPathfindingProgram.bind(); gGL.flush(); - glLineWidth(1.0f); + gGL.setLineWidth(1.0f); } glPolygonOffset(0.f, 0.f); @@ -4978,7 +4989,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) { @@ -4996,7 +5007,7 @@ void LLPipeline::renderDebug() } } gGL.flush(); - glLineWidth(1.f);*/ + gGL.setLineWidth(1.f);*/ } } @@ -7012,7 +7023,7 @@ void apply_cube_face_rotation(U32 face) void validate_framebuffer_object() { GLenum status; - status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); switch(status) { case GL_FRAMEBUFFER_COMPLETE: @@ -9398,7 +9409,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(); |
