Make legacy renderpath a bit more strict.
This commit is contained in:
@@ -1428,7 +1428,7 @@ void LLDrawPoolInvisible::render(S32 pass)
|
|||||||
{ //render invisiprims
|
{ //render invisiprims
|
||||||
LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
|
LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
|
||||||
|
|
||||||
if (gPipeline.canUseVertexShaders())
|
if (LLGLSLShader::sNoFixedFunction)
|
||||||
{
|
{
|
||||||
gOcclusionProgram.bind();
|
gOcclusionProgram.bind();
|
||||||
}
|
}
|
||||||
@@ -1440,7 +1440,7 @@ void LLDrawPoolInvisible::render(S32 pass)
|
|||||||
gGL.setColorMask(true, false);
|
gGL.setColorMask(true, false);
|
||||||
glStencilMask(0xFFFFFFFF);
|
glStencilMask(0xFFFFFFFF);
|
||||||
|
|
||||||
if (gPipeline.canUseVertexShaders())
|
if (LLGLSLShader::sNoFixedFunction)
|
||||||
{
|
{
|
||||||
gOcclusionProgram.unbind();
|
gOcclusionProgram.unbind();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,13 +66,16 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
|
|||||||
LLFacePool(POOL_TERRAIN),
|
LLFacePool(POOL_TERRAIN),
|
||||||
mTexturep(texturep)
|
mTexturep(texturep)
|
||||||
{
|
{
|
||||||
|
U32 format = GL_ALPHA8;
|
||||||
|
U32 int_format = GL_ALPHA;
|
||||||
|
|
||||||
// Hack!
|
// Hack!
|
||||||
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
|
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
|
||||||
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
|
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
|
||||||
mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
|
mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
|
||||||
TRUE, LLViewerTexture::BOOST_UI,
|
TRUE, LLViewerTexture::BOOST_UI,
|
||||||
LLViewerTexture::FETCHED_TEXTURE,
|
LLViewerTexture::FETCHED_TEXTURE,
|
||||||
GL_ALPHA8, GL_ALPHA,
|
format, int_format,
|
||||||
LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
|
LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
|
||||||
|
|
||||||
//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
|
//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
|
||||||
@@ -81,7 +84,7 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
|
|||||||
m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
|
m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
|
||||||
TRUE, LLViewerTexture::BOOST_UI,
|
TRUE, LLViewerTexture::BOOST_UI,
|
||||||
LLViewerTexture::FETCHED_TEXTURE,
|
LLViewerTexture::FETCHED_TEXTURE,
|
||||||
GL_ALPHA8, GL_ALPHA,
|
format, int_format,
|
||||||
LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
|
LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
|
||||||
|
|
||||||
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
|
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
|
|||||||
|
|
||||||
if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount())
|
if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount())
|
||||||
{
|
{
|
||||||
if (gPipeline.canUseVertexShaders())
|
if (LLGLSLShader::sNoFixedFunction)
|
||||||
{
|
{
|
||||||
gUIProgram.bind();
|
gUIProgram.bind();
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
|
|||||||
LLFacePool::LLOverrideFaceColor color_override(this, color);
|
LLFacePool::LLOverrideFaceColor color_override(this, color);
|
||||||
face->renderIndexed();
|
face->renderIndexed();
|
||||||
|
|
||||||
if (gPipeline.canUseVertexShaders())
|
if (LLGLSLShader::sNoFixedFunction)
|
||||||
{
|
{
|
||||||
gUIProgram.unbind();
|
gUIProgram.unbind();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ void settings_setup_listeners()
|
|||||||
gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||||
gSavedSettings.getControl("OctreeAlphaDistanceFactor")->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("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("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||||
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||||
gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||||
|
|||||||
@@ -1966,11 +1966,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||||||
|
|
||||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||||
|
|
||||||
bool bound_shader = false;
|
bool bind_shader = LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShader == 0;
|
||||||
if (gPipeline.canUseVertexShaders() && LLGLSLShader::sCurBoundShader == 0)
|
if (bind_shader)
|
||||||
{ //if no shader is currently bound, use the occlusion shader instead of fixed function if we can
|
{ //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)
|
// (shadow render uses a special shader that clamps to clip planes)
|
||||||
bound_shader = true;
|
|
||||||
gOcclusionProgram.bind();
|
gOcclusionProgram.bind();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2001,7 +2000,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bound_shader)
|
if (bind_shader)
|
||||||
{
|
{
|
||||||
gOcclusionProgram.unbind();
|
gOcclusionProgram.unbind();
|
||||||
}
|
}
|
||||||
@@ -8099,7 +8098,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
|
|||||||
LLVertexBuffer::unbind();
|
LLVertexBuffer::unbind();
|
||||||
|
|
||||||
{
|
{
|
||||||
if (!use_shader)
|
if (!use_shader && LLGLSLShader::sNoFixedFunction)
|
||||||
{ //occlusion program is general purpose depth-only no-textures
|
{ //occlusion program is general purpose depth-only no-textures
|
||||||
gOcclusionProgram.bind();
|
gOcclusionProgram.bind();
|
||||||
}
|
}
|
||||||
@@ -8110,7 +8109,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
|
|||||||
renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
|
renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
|
||||||
}
|
}
|
||||||
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
|
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
|
||||||
if (!use_shader)
|
if (!use_shader && LLGLSLShader::sNoFixedFunction)
|
||||||
{
|
{
|
||||||
gOcclusionProgram.unbind();
|
gOcclusionProgram.unbind();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user