From ca780f4406c3f8d668d91e39b62d9bf81bf49ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 18 May 2022 21:44:30 +0200 Subject: GL: Fix gl error during debug name setup for shader storage buffers --- source/blender/gpu/opengl/gl_debug.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/gpu/opengl/gl_debug.cc b/source/blender/gpu/opengl/gl_debug.cc index a3288ff4cff..f82138e0d65 100644 --- a/source/blender/gpu/opengl/gl_debug.cc +++ b/source/blender/gpu/opengl/gl_debug.cc @@ -331,11 +331,21 @@ void object_label(GLenum type, GLuint object, const char *name) char label[64]; SNPRINTF(label, "%s%s%s", to_str_prefix(type), name, to_str_suffix(type)); /* Small convenience for caller. */ - if (ELEM(type, GL_FRAGMENT_SHADER, GL_GEOMETRY_SHADER, GL_VERTEX_SHADER, GL_COMPUTE_SHADER)) { - type = GL_SHADER; - } - if (ELEM(type, GL_UNIFORM_BUFFER)) { - type = GL_BUFFER; + switch (type) { + case GL_FRAGMENT_SHADER: + case GL_GEOMETRY_SHADER: + case GL_VERTEX_SHADER: + case GL_COMPUTE_SHADER: + type = GL_SHADER; + break; + case GL_UNIFORM_BUFFER: + case GL_SHADER_STORAGE_BUFFER: + case GL_ARRAY_BUFFER: + case GL_ELEMENT_ARRAY_BUFFER: + type = GL_BUFFER; + break; + default: + break; } glObjectLabel(type, object, -1, label); } -- cgit v1.2.3