From be1cdc1aaa67eca71fee8cbbc16b4c85bcbdb258 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 5 Oct 2022 09:48:18 -0700 Subject: Initial pass at adding KHR_debug support This still needs some work - I'm not super satisfied with the overall structure of the code. Will continue to iterate as I add in proper RenderDoc support. --- indra/newview/lldrawpool.h | 136 +++++++++++++++++++++++++++++++++++++++++++ indra/newview/llvovolume.cpp | 2 + 2 files changed, 138 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index f7fc2d2061..e664208154 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -198,6 +198,142 @@ public: NUM_RENDER_TYPES, }; + #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL + static std::string lookupPassName(U32 pass) + { + switch (pass) + { + case PASS_SIMPLE: + return "PASS_SIMPLE"; + case PASS_SIMPLE_RIGGED: + return "PASS_SIMPLE_RIGGED"; + case PASS_GRASS: + return "PASS_GRASS"; + case PASS_FULLBRIGHT: + return "PASS_FULLBRIGHT"; + case PASS_FULLBRIGHT_RIGGED: + return "PASS_FULLBRIGHT_RIGGED"; + case PASS_INVISIBLE: + return "PASS_INVISIBLE"; + case PASS_INVISIBLE_RIGGED: + return "PASS_INVISIBLE_RIGGED"; + case PASS_INVISI_SHINY: + return "PASS_INVISI_SHINY"; + case PASS_INVISI_SHINY_RIGGED: + return "PASS_INVISI_SHINY_RIGGED"; + case PASS_FULLBRIGHT_SHINY: + return "PASS_FULLBRIGHT_SHINY"; + case PASS_FULLBRIGHT_SHINY_RIGGED: + return "PASS_FULLBRIGHT_SHINY_RIGGED"; + case PASS_SHINY: + return "PASS_SHINY"; + case PASS_SHINY_RIGGED: + return "PASS_SHINY_RIGGED"; + case PASS_BUMP: + return "PASS_BUMP"; + case PASS_BUMP_RIGGED: + return "PASS_BUMP_RIGGED"; + case PASS_POST_BUMP: + return "PASS_POST_BUMP"; + case PASS_POST_BUMP_RIGGED: + return "PASS_POST_BUMP_RIGGED"; + case PASS_MATERIAL: + return "PASS_MATERIAL"; + case PASS_MATERIAL_RIGGED: + return "PASS_MATERIAL_RIGGED"; + case PASS_MATERIAL_ALPHA: + return "PASS_MATERIAL_ALPHA"; + case PASS_MATERIAL_ALPHA_RIGGED: + return "PASS_MATERIAL_ALPHA_RIGGED"; + case PASS_MATERIAL_ALPHA_MASK: + return "PASS_MATERIAL_ALPHA_MASK"; + case PASS_MATERIAL_ALPHA_MASK_RIGGED: + return "PASS_MATERIAL_ALPHA_MASK_RIGGED"; + case PASS_MATERIAL_ALPHA_EMISSIVE: + return "PASS_MATERIAL_ALPHA_EMISSIVE"; + case PASS_MATERIAL_ALPHA_EMISSIVE_RIGGED: + return "PASS_MATERIAL_ALPHA_EMISSIVE_RIGGED"; + case PASS_SPECMAP: + return "PASS_SPECMAP"; + case PASS_SPECMAP_RIGGED: + return "PASS_SPECMAP_RIGGED"; + case PASS_SPECMAP_BLEND: + return "PASS_SPECMAP_BLEND"; + case PASS_SPECMAP_BLEND_RIGGED: + return "PASS_SPECMAP_BLEND_RIGGED"; + case PASS_SPECMAP_MASK: + return "PASS_SPECMAP_MASK"; + case PASS_SPECMAP_MASK_RIGGED: + return "PASS_SPECMAP_MASK_RIGGED"; + case PASS_SPECMAP_EMISSIVE: + return "PASS_SPECMAP_EMISSIVE"; + case PASS_SPECMAP_EMISSIVE_RIGGED: + return "PASS_SPECMAP_EMISSIVE_RIGGED"; + case PASS_NORMMAP: + return "PASS_NORMAMAP"; + case PASS_NORMMAP_RIGGED: + return "PASS_NORMMAP_RIGGED"; + case PASS_NORMMAP_BLEND: + return "PASS_NORMMAP_BLEND"; + case PASS_NORMMAP_BLEND_RIGGED: + return "PASS_NORMMAP_BLEND_RIGGED"; + case PASS_NORMMAP_MASK: + return "PASS_NORMMAP_MASK"; + case PASS_NORMMAP_MASK_RIGGED: + return "PASS_NORMMAP_MASK_RIGGED"; + case PASS_NORMMAP_EMISSIVE: + return "PASS_NORMMAP_EMISSIVE"; + case PASS_NORMMAP_EMISSIVE_RIGGED: + return "PASS_NORMMAP_EMISSIVE_RIGGED"; + case PASS_NORMSPEC: + return "PASS_NORMSPEC"; + case PASS_NORMSPEC_RIGGED: + return "PASS_NORMSPEC_RIGGED"; + case PASS_NORMSPEC_BLEND: + return "PASS_NORMSPEC_BLEND"; + case PASS_NORMSPEC_BLEND_RIGGED: + return "PASS_NORMSPEC_BLEND_RIGGED"; + case PASS_NORMSPEC_MASK: + return "PASS_NORMSPEC_MASK"; + case PASS_NORMSPEC_MASK_RIGGED: + return "PASS_NORMSPEC_MASK_RIGGED"; + case PASS_NORMSPEC_EMISSIVE: + return "PASS_NORMSPEC_EMISSIVE"; + case PASS_NORMSPEC_EMISSIVE_RIGGED: + return "PASS_NORMSPEC_EMISSIVE_RIGGED"; + case PASS_GLOW: + return "PASS_GLOW"; + case PASS_GLOW_RIGGED: + return "PASS_GLOW_RIGGED"; + case PASS_ALPHA: + return "PASS_ALPHA"; + case PASS_ALPHA_RIGGED: + return "PASS_ALPHA_RIGGED"; + case PASS_ALPHA_MASK: + return "PASS_ALPHA_MASK"; + case PASS_ALPHA_MASK_RIGGED: + return "PASS_ALPHA_MASK_RIGGED"; + case PASS_FULLBRIGHT_ALPHA_MASK: + return "PASS_FULLBRIGHT_ALPHA_MASK"; + case PASS_FULLBRIGHT_ALPHA_MASK_RIGGED: + return "PASS_FULLBRIGHT_ALPHA_MASK_RIGGED"; + case PASS_ALPHA_INVISIBLE: + return "PASS_ALPHA_INVISIBLE"; + case PASS_ALPHA_INVISIBLE_RIGGED: + return "PASS_ALPHA_INVISIBLE_RIGGED"; + case PASS_PBR_OPAQUE: + return "PASS_PBR_OPAQUE"; + case PASS_PBR_OPAQUE_RIGGED: + return "PASS_PBR_OPAQUE_RIGGED"; + + default: + return "Unknown pass"; + } + } + #else + static std::string lookupPass(U32 pass) { return ""; } + #endif + LLRenderPass(const U32 type); virtual ~LLRenderPass(); /*virtual*/ LLViewerTexture* getDebugTexture() { return NULL; } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d18997b780..d312bb75d1 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5319,6 +5319,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, return; } + LL_LABEL_VERTEX_BUFFER(facep->getVertexBuffer(), LLRenderPass::lookupPassName(type)); + U32 passType = type; bool rigged = facep->isState(LLFace::RIGGED); -- cgit v1.2.3 From db92f9564992b9910b21f3de57a584ccfa199e75 Mon Sep 17 00:00:00 2001 From: Geenz Linden Date: Thu, 6 Oct 2022 15:18:17 -0400 Subject: Switch away from std::string API expects const char* anyways. --- indra/newview/lldrawpool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index e664208154..e8fde70ed0 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -199,7 +199,7 @@ public: }; #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL - static std::string lookupPassName(U32 pass) + static inline const char* lookupPassName(U32 pass) { switch (pass) { @@ -331,7 +331,7 @@ public: } } #else - static std::string lookupPass(U32 pass) { return ""; } + static inline const char* lookupPass(U32 pass) { return ""; } #endif LLRenderPass(const U32 type); -- cgit v1.2.3