diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-09 23:28:39 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-09 23:28:39 +0300 |
commit | 96a62d094f16df970788e13a35f1f22dc349b564 (patch) | |
tree | 482a1b40708bb69c9e7f66253a2e323e40f68100 /source/blender/gpu/opengl/gl_framebuffer.cc | |
parent | 59467d8c94a96de48364eec5f2a4c37389434cbf (diff) |
Wrap glObjectLabel and shorten object labeltmp-gldebuglayer
Diffstat (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_framebuffer.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index 563feacde51..1578c5fa619 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -65,10 +65,8 @@ GLFrameBuffer::GLFrameBuffer( viewport_[2] = scissor_[2] = w; viewport_[3] = scissor_[3] = h; - if (fbo_id_ && GLContext::debug_layer_support) { - char sh_name[32]; - SNPRINTF(sh_name, "FrameBuffer-%s", name); - glObjectLabel(GL_FRAMEBUFFER, fbo_id_, -1, sh_name); + if (fbo_id_) { + debug::object_label(GL_FRAMEBUFFER, fbo_id_, name_); } } @@ -99,14 +97,11 @@ void GLFrameBuffer::init(void) context_ = GLContext::get(); state_manager_ = static_cast<GLStateManager *>(context_->state_manager); glGenFramebuffers(1, &fbo_id_); + /* Binding before setting the label is needed on some drivers. + * This is not an issue since we call this function only before binding. */ + glBindFramebuffer(GL_FRAMEBUFFER, fbo_id_); - if (GLContext::debug_layer_support) { - char sh_name[64]; - SNPRINTF(sh_name, "FrameBuffer-%s", name_); - /* Binding before setting the label is needed on some drivers. */ - glBindFramebuffer(GL_FRAMEBUFFER, fbo_id_); - glObjectLabel(GL_FRAMEBUFFER, fbo_id_, -1, sh_name); - } + debug::object_label(GL_FRAMEBUFFER, fbo_id_, name_); } /** \} */ |