From f7fab77f85734e49414ea7d063532dbac6c5b6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 9 Sep 2020 00:23:48 +0200 Subject: Cleanup: GPU: Replace multiple checks by GLContext::debug_layer_support --- source/blender/gpu/opengl/gl_framebuffer.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc') diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index 14b7d78c2ff..bfc8a2f74eb 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -63,13 +63,11 @@ GLFrameBuffer::GLFrameBuffer( viewport_[2] = scissor_[2] = w; viewport_[3] = scissor_[3] = h; -#ifndef __APPLE__ - if (fbo_id_ && (G.debug & G_DEBUG_GPU) && (GLEW_VERSION_4_3 || GLEW_KHR_debug)) { + 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); } -#endif } GLFrameBuffer::~GLFrameBuffer() @@ -100,15 +98,13 @@ void GLFrameBuffer::init(void) state_manager_ = static_cast(context_->state_manager); glGenFramebuffers(1, &fbo_id_); -#ifndef __APPLE__ - if ((G.debug & G_DEBUG_GPU) && (GLEW_VERSION_4_3 || GLEW_KHR_debug)) { + 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); } -#endif } /** \} */ -- cgit v1.2.3