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/llrender/llglslshader.cpp | 6 +++--- indra/llrender/llglslshader.h | 2 +- indra/llrender/llvertexbuffer.cpp | 6 ++++-- indra/llrender/llvertexbuffer.h | 2 +- indra/newview/lldrawpool.h | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index f424a01541..27de7070ff 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -505,7 +505,7 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, } #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL - setLabel(mName); + setLabel(mName.c_str()); #endif return success; @@ -1792,8 +1792,8 @@ void LLShaderUniforms::apply(LLGLSLShader* shader) } #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL -void LLGLSLShader::setLabel(std::string label) { - LL_LABEL_OBJECT_GL(GL_PROGRAM, mProgramObject, label.length(), label.c_str()); +void LLGLSLShader::setLabel(const char* label) { + LL_LABEL_OBJECT_GL(GL_PROGRAM, mProgramObject, strlen(label), label); } #endif diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 01eca7ebfe..fd69f43f87 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -295,7 +295,7 @@ public: LLGLSLShader* mRiggedVariant = nullptr; #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL - void setLabel(std::string label); + void setLabel(const char* label); #endif private: diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 4ce04c17f6..33dcd6c563 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -574,9 +574,11 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of } } -void LLVertexBuffer::setLabel(std::string label) { - LL_LABEL_OBJECT_GL(GL_BUFFER, mGLBuffer, label.length(), label.c_str()); +#ifdef LL_PROFILER_ENABLE_TRACY_OPENGL +void LLVertexBuffer::setLabel(const char* label) { + LL_LABEL_OBJECT_GL(GL_BUFFER, mGLBuffer, strlen(label), label); } +#endif void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const { diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index a7e5fddf8c..d6f681e4ca 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -301,7 +301,7 @@ public: void validateRange(U32 start, U32 end, U32 count, U32 offset) const; #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL - void setLabel(std::string label); + void setLabel(const char* label); #endif 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