Make legacy renderpath a bit more strict.

This commit is contained in:
Shyotl
2011-10-20 13:30:29 -05:00
parent 40261d3472
commit 22385c44c8
5 changed files with 15 additions and 13 deletions

View File

@@ -1428,7 +1428,7 @@ void LLDrawPoolInvisible::render(S32 pass)
{ //render invisiprims
LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
if (gPipeline.canUseVertexShaders())
if (LLGLSLShader::sNoFixedFunction)
{
gOcclusionProgram.bind();
}
@@ -1440,7 +1440,7 @@ void LLDrawPoolInvisible::render(S32 pass)
gGL.setColorMask(true, false);
glStencilMask(0xFFFFFFFF);
if (gPipeline.canUseVertexShaders())
if (LLGLSLShader::sNoFixedFunction)
{
gOcclusionProgram.unbind();
}

View File

@@ -66,13 +66,16 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
LLFacePool(POOL_TERRAIN),
mTexturep(texturep)
{
U32 format = GL_ALPHA8;
U32 int_format = GL_ALPHA;
// Hack!
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
TRUE, LLViewerTexture::BOOST_UI,
LLViewerTexture::FETCHED_TEXTURE,
GL_ALPHA8, GL_ALPHA,
format, int_format,
LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
@@ -81,7 +84,7 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
TRUE, LLViewerTexture::BOOST_UI,
LLViewerTexture::FETCHED_TEXTURE,
GL_ALPHA8, GL_ALPHA,
format, int_format,
LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());

View File

@@ -281,7 +281,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount())
{
if (gPipeline.canUseVertexShaders())
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.bind();
}
@@ -301,7 +301,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLFacePool::LLOverrideFaceColor color_override(this, color);
face->renderIndexed();
if (gPipeline.canUseVertexShaders())
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.unbind();
}

View File

@@ -652,7 +652,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));

View File

@@ -1966,11 +1966,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
bool bound_shader = false;
if (gPipeline.canUseVertexShaders() && LLGLSLShader::sCurBoundShader == 0)
bool bind_shader = LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShader == 0;
if (bind_shader)
{ //if no shader is currently bound, use the occlusion shader instead of fixed function if we can
// (shadow render uses a special shader that clamps to clip planes)
bound_shader = true;
gOcclusionProgram.bind();
}
@@ -2001,7 +2000,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
}
}
if (bound_shader)
if (bind_shader)
{
gOcclusionProgram.unbind();
}
@@ -8099,7 +8098,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
LLVertexBuffer::unbind();
{
if (!use_shader)
if (!use_shader && LLGLSLShader::sNoFixedFunction)
{ //occlusion program is general purpose depth-only no-textures
gOcclusionProgram.bind();
}
@@ -8110,7 +8109,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
}
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
if (!use_shader)
if (!use_shader && LLGLSLShader::sNoFixedFunction)
{
gOcclusionProgram.unbind();
}