diff options
author | Dave Parks <davep@lindenlab.com> | 2023-02-07 18:25:22 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-02-07 18:25:22 -0600 |
commit | a2647e953aeee26ef99e62e0146adcd37c8afca1 (patch) | |
tree | afb8c28e3ca63eb0f3c5773e3230aa24fe9ff77d /indra/newview/lldrawpoolpbropaque.cpp | |
parent | be9e4f186db1b3612a26e27a0294114ca66c539c (diff) |
SL-18229 Fix for PBR materials on HUDs misbehaving. Incidental decruft.
Diffstat (limited to 'indra/newview/lldrawpoolpbropaque.cpp')
-rw-r--r-- | indra/newview/lldrawpoolpbropaque.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/indra/newview/lldrawpoolpbropaque.cpp b/indra/newview/lldrawpoolpbropaque.cpp index 9dd1bc0ba2..c5413a068a 100644 --- a/indra/newview/lldrawpoolpbropaque.cpp +++ b/indra/newview/lldrawpoolpbropaque.cpp @@ -31,22 +31,46 @@ #include "llviewershadermgr.h" #include "pipeline.h" +static const U32 gltf_render_types[] = { LLPipeline::RENDER_TYPE_PASS_GLTF_PBR, LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK }; + LLDrawPoolGLTFPBR::LLDrawPoolGLTFPBR() : LLRenderPass(POOL_GLTF_PBR) { } +S32 LLDrawPoolGLTFPBR::getNumDeferredPasses() +{ + return 1; +} + void LLDrawPoolGLTFPBR::renderDeferred(S32 pass) { - const U32 types[] = { LLPipeline::RENDER_TYPE_PASS_GLTF_PBR, LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK }; + llassert(!LLPipeline::sRenderingHUDs); - for (U32 type : types) + for (U32 type : gltf_render_types) { gDeferredPBROpaqueProgram.bind(); pushGLTFBatches(type); - + gDeferredPBROpaqueProgram.bind(true); - pushRiggedGLTFBatches(type+1); + pushRiggedGLTFBatches(type + 1); + } +} + +S32 LLDrawPoolGLTFPBR::getNumPostDeferredPasses() +{ + return LLPipeline::sRenderingHUDs ? 1 : 0; +} + +void LLDrawPoolGLTFPBR::renderPostDeferred(S32 pass) +{ + // only HUD rendering should execute this pass + llassert(LLPipeline::sRenderingHUDs); + + gHUDPBROpaqueProgram.bind(); + for (U32 type : gltf_render_types) + { + pushGLTFBatches(type); } } |