From 2a138acf6c4ad5a4e2913ae9c1e7e362eb7cf3fe Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 7 Aug 2020 13:39:00 +0100 Subject: [PATCH] Don't call glBindFragDataLocation on GLES even if we have a func pointer * The function is illegal to call regardless of whether we get a non-NULL function pointer. Core GLES doesn't support glBindFragDataLocation but fortunately we don't need to call it ourselves unless the user has done some dynamic binding - which assumes glBindFragDataLocation is available. --- renderdoc/driver/gl/gl_program_iterate.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/renderdoc/driver/gl/gl_program_iterate.cpp b/renderdoc/driver/gl/gl_program_iterate.cpp index ae1dadb7c..1f6fd85bf 100644 --- a/renderdoc/driver/gl/gl_program_iterate.cpp +++ b/renderdoc/driver/gl/gl_program_iterate.cpp @@ -1339,16 +1339,12 @@ bool CopyProgramFragDataBindings(GLuint progsrc, GLuint progdst, ShaderReflectio used |= mask; - if(GL.glBindFragDataLocation) + // glBindFragDataLocation is not core GLES. However when it's not available that means the + // user must have explicitly specified locations so we don't need to set them. + if(!IsGLES && GL.glBindFragDataLocation) { GL.glBindFragDataLocation(progdst, (GLuint)idx, refl->outputSignature[i].varName.c_str()); } - else - { - // glBindFragDataLocation is not core GLES, but it is in GL_EXT_blend_func_extended - // TODO what to do if that extension is not supported - RDCWARN("glBindFragDataLocation is not supported!"); - } } } @@ -1445,16 +1441,12 @@ bool SerialiseProgramBindings(SerialiserType &ser, CaptureState state, } else { - if(GL.glBindFragDataLocation) + // glBindFragDataLocation is not core GLES. However when it's not available that means + // the user must have explicitly specified locations so we don't need to set them. + if(!IsGLES && GL.glBindFragDataLocation) { GL.glBindFragDataLocation(prog, (GLuint)bind.Binding, bind.Name.c_str()); } - else - { - // glBindFragDataLocation is not core GLES, but it is in GL_EXT_blend_func_extended - // TODO what to do if that extension is not supported - RDCWARN("glBindFragDataLocation is not supported!"); - } } } }