diff options
-rw-r--r-- | indra/llrender/llgl.cpp | 8 | ||||
-rw-r--r-- | indra/llrender/llgl.h | 1 | ||||
-rw-r--r-- | indra/llrender/llimagegl.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llrender.cpp | 11 | ||||
-rw-r--r-- | indra/llui/llspinctrl.h | 3 | ||||
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llfloaterhardwaresettings.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 13 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_hardware_settings.xml | 2 |
10 files changed, 63 insertions, 20 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 20ca189e7f..946e602fee 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -835,14 +835,6 @@ std::string LLGLManager::getRawGLString() return gl_string; } -U32 LLGLManager::getNumFBOFSAASamples(U32 samples) -{ - samples = llmin(samples, (U32) mMaxColorTextureSamples); - samples = llmin(samples, (U32) mMaxDepthTextureSamples); - samples = llmin(samples, (U32) 4); - return samples; -} - void LLGLManager::shutdownGL() { if (mInited) diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index dee7ec0739..6a147b8e19 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -150,7 +150,6 @@ public: void printGLInfoString(); void getGLInfo(LLSD& info); - U32 getNumFBOFSAASamples(U32 desired_samples = 32); // In ALL CAPS std::string mGLVendor; std::string mGLVendorShort; diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 789402c4a9..78591ddd38 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1838,7 +1838,7 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) // this to be an intentional effect and don't treat as a mask. U32 midrangetotal = 0; - for (U32 i = 4; i < 11; i++) + for (U32 i = 2; i < 13; i++) { midrangetotal += sample[i]; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 97aeae548a..812fa7024b 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1887,6 +1887,17 @@ void LLRender::flush() void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) { //the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095] + if (mCount > 2048) + { //break when buffer gets reasonably full to keep GL command buffers happy and avoid overflow below + switch (mMode) + { + case LLRender::POINTS: flush(); break; + case LLRender::TRIANGLES: if (mCount%3==0) flush(); break; + case LLRender::QUADS: if(mCount%4 == 0) flush(); break; + case LLRender::LINES: if (mCount%2 == 0) flush(); break; + } + } + if (mCount > 4094) { // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h index d197084e38..87814f838e 100644 --- a/indra/llui/llspinctrl.h +++ b/indra/llui/llspinctrl.h @@ -96,6 +96,9 @@ public: void onUpBtn(const LLSD& data); void onDownBtn(const LLSD& data); + + const LLColor4& getEnabledTextColor() const { return mTextEnabledColor.get(); } + const LLColor4& getDisabledTextColor() const { return mTextDisabledColor.get(); } private: void updateLabelColor(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 60313b25a0..55b314fbb1 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -657,7 +657,7 @@ void LLDrawPoolAvatar::endDeferredImpostor() void LLDrawPoolAvatar::beginDeferredRigid() { sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; - + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(0.2f); } @@ -665,6 +665,7 @@ void LLDrawPoolAvatar::beginDeferredRigid() void LLDrawPoolAvatar::endDeferredRigid() { sShaderLevel = mVertexShaderLevel; + sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->unbind(); gGL.getTexUnit(0)->activate(); } diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 42ec7d765b..f9a403cf9f 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -34,7 +34,9 @@ #include "llviewercontrol.h" #include "llviewertexturelist.h" #include "llfeaturemanager.h" +#include "llspinctrl.h" #include "llstartup.h" +#include "lltextbox.h" #include "pipeline.h" // Linden library includes @@ -98,18 +100,40 @@ void LLFloaterHardwareSettings::refreshEnabledState() } // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - getChildView("gamma")->setEnabled(!gPipeline.canUseWindLightShaders()); + LLSpinCtrl* gamma_ctrl = getChild<LLSpinCtrl>("gamma"); + gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fsaa")->setEnabled(gPipeline.canUseAntiAliasing()); - getChildView("antialiasing restart")->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); - /* Enable to reset fsaa value to disabled when feature is not available. - if (!gPipeline.canUseAntiAliasing()) + // anti-aliasing { - getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) 0); + LLUICtrl* fsaa_ctrl = getChild<LLUICtrl>("fsaa"); + LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label"); + LLView* fsaa_restart = getChildView("antialiasing restart"); + + // Enable or disable the control, the "Antialiasing:" label and the restart warning + // based on code support for the feature on the current hardware. + + if (gPipeline.canUseAntiAliasing()) + { + fsaa_ctrl->setEnabled(TRUE); + + // borrow the text color from the gamma control for consistency + fsaa_text->setColor(gamma_ctrl->getEnabledTextColor()); + + fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); + } + else + { + fsaa_ctrl->setEnabled(FALSE); + fsaa_ctrl->setValue((LLSD::Integer) 0); + + // borrow the text color from the gamma control for consistency + fsaa_text->setColor(gamma_ctrl->getDisabledTextColor()); + + fsaa_restart->setVisible(FALSE); + } } - */ } //============================================================================ diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 830a7778ac..5d0d1ef9a3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5713,6 +5713,14 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) return; } + + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + + if (shader) + { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes + gSolidColorProgram.bind(); + } + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); gGL.pushUIMatrix(); @@ -5835,6 +5843,11 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) } gGL.popMatrix(); gGL.popUIMatrix(); + + if (shader) + { + shader->bind(); + } } // diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c9e1b44b3f..5e9f0e3efe 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -658,7 +658,7 @@ void LLPipeline::allocatePhysicsBuffer() void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) { refreshCachedSettings(); - U32 samples = gGLManager.getNumFBOFSAASamples(RenderFSAASamples); + U32 samples = RenderFSAASamples; //try to allocate screen buffers at requested resolution and samples // - on failure, shrink number of samples and try again diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 05f4c52b95..66bb9d3cea 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -35,7 +35,7 @@ height="12" layout="topleft" left="10" - name="Antialiasing:" + name="antialiasing label" top_pad="7" width="188"> Antialiasing: |