diff options
author | Dave Parks <davep@lindenlab.com> | 2011-06-08 19:14:49 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-06-08 19:14:49 -0500 |
commit | 0c6d1f7cf2e821f4ffe3a3bf88c57948eea1e569 (patch) | |
tree | fe831fbb4e644061ccddf244aa4fcaed8bf275b1 /indra/newview/lldrawpoolalpha.cpp | |
parent | d3aa36f1d478d51790e0fdf604e590baa04a93a4 (diff) |
SH-1692 Factor out all (but one) of the bindDeferredShader calls in lldrawpoolalpha.
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 71eee0188c..537f6216c2 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -125,6 +125,9 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) { simple_shader = &gDeferredAlphaProgram; fullbright_shader = &gObjectFullbrightProgram; + + //prime simple shader (loads shadow relevant uniforms) + gPipeline.bindDeferredShader(*simple_shader); } else { @@ -290,11 +293,6 @@ void LLDrawPoolAlpha::render(S32 pass) gGL.setSceneBlendType(LLRender::BT_ALPHA); } - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - } - if (sShowDebugAlpha) { if(gPipeline.canUseWindLightShaders()) @@ -411,29 +409,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) if(use_shaders && (current_shader != target_shader)) { llassert(target_shader != NULL); - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } current_shader = target_shader; - if (deferred_render) - { - gPipeline.bindDeferredShader(*current_shader); - diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - } - else - { - current_shader->bind(); - } + current_shader->bind(); } else if (!use_shaders && current_shader != NULL) { - if (deferred_render) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } LLGLSLShader::bindNoShader(); current_shader = NULL; } @@ -510,12 +490,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - LLVertexBuffer::unbind(); - } - + LLVertexBuffer::unbind(); + if (!light_enabled) { gPipeline.enableLightsDynamic(); |