diff options
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 11 | ||||
-rw-r--r-- | indra/llrender/llglslshader.h | 9 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 9 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.h | 9 |
4 files changed, 37 insertions, 1 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 55713eea80..27de7070ff 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -504,6 +504,10 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes, unbind(); } +#ifdef LL_PROFILER_ENABLE_TRACY_OPENGL + setLabel(mName.c_str()); +#endif + return success; } @@ -1786,3 +1790,10 @@ void LLShaderUniforms::apply(LLGLSLShader* shader) shader->uniform3fv(uniform.mUniform, 1, uniform.mValue.mV); } } + +#ifdef LL_PROFILER_ENABLE_TRACY_OPENGL +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 c26ee014cb..fd69f43f87 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -294,6 +294,10 @@ public: // this pointer should be set to whichever shader represents this shader's rigged variant LLGLSLShader* mRiggedVariant = nullptr; + #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL + void setLabel(const char* label); + #endif + private: void unloadInternal(); }; @@ -305,5 +309,10 @@ extern LLGLSLShader gSolidColorProgram; //Alpha mask shader (declared here so llappearance can access properly) extern LLGLSLShader gAlphaMaskProgram; +#ifdef LL_PROFILER_ENABLE_TRACY_OPENGL +#define LL_SET_SHADER_LABEL(shader) shader.setLabel(#shader) +#else +#define LL_SET_SHADER_LABEL(shader, label) +#endif #endif diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 981175d845..33dcd6c563 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -175,7 +175,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) { //make a new buffer name = genBuffer(); - + glBindBuffer(mType, name); if (!for_seed && i < LL_VBO_POOL_SEED_COUNT) @@ -574,6 +574,12 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of } } +#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 { validateRange(start, end, count, indices_offset); @@ -1068,6 +1074,7 @@ bool LLVertexBuffer::createGLBuffer(U32 size) { static int gl_buffer_idx = 0; mGLBuffer = ++gl_buffer_idx; + mMappedData = (U8*)ll_aligned_malloc_16(size); mSize = size; } diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index a7907f9cae..d6f681e4ca 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -300,6 +300,9 @@ public: //for debugging, validate data in given range is valid void validateRange(U32 start, U32 end, U32 count, U32 offset) const; + #ifdef LL_PROFILER_ENABLE_TRACY_OPENGL + void setLabel(const char* label); + #endif protected: @@ -370,5 +373,11 @@ public: static U32 sSetCount; }; +#ifdef LL_PROFILER_ENABLE_TRACY_OPENGL +#define LL_LABEL_VERTEX_BUFFER(buf, name) buf->setLabel(name) +#else +#define LL_LABEL_VERTEX_BUFFER(buf, name) +#endif + #endif // LL_LLVERTEXBUFFER_H |