From a2647e953aeee26ef99e62e0146adcd37c8afca1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 7 Feb 2023 18:25:22 -0600 Subject: SL-18229 Fix for PBR materials on HUDs misbehaving. Incidental decruft. --- indra/newview/lldrawpoolpbropaque.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'indra/newview/lldrawpoolpbropaque.cpp') 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); } } -- cgit v1.2.3