From 00bf36fd2767e27ec4ee36e7a84e14703b203152 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 15 May 2019 11:26:26 +0100 Subject: [PATCH] Don't query uniform value for atomic counter uniforms * These cannot be rebound so are fixed, and have no location. --- renderdoc/driver/gl/gl_program_iterate.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/gl/gl_program_iterate.cpp b/renderdoc/driver/gl/gl_program_iterate.cpp index e8d2b300c..a6bfa651c 100644 --- a/renderdoc/driver/gl/gl_program_iterate.cpp +++ b/renderdoc/driver/gl/gl_program_iterate.cpp @@ -381,12 +381,22 @@ static void ForAllProgramUniforms(SerialiserType *ser, CaptureState state, GLuin std::string name = basename; + // atomic counters cannot be changed, don't fetch their value + if(type == eGL_UNSIGNED_INT_ATOMIC_COUNTER) + continue; + + if(srcLocation == -1) + RDCWARN("Couldn't get srcLocation for %s", name.c_str()); + // append the subscript if this item is an array. if(isArray) { name += StringFormat::Fmt("[%d]", arr); uniformVal.Location = srcLocation = GL.glGetUniformLocation(progSrc, name.c_str()); + + if(srcLocation == -1) + RDCWARN("Couldn't get srcLocation for %s", name.c_str()); } // fetch the data into the ProgramUniformValue, with the appropriate method for its type @@ -498,7 +508,6 @@ static void ForAllProgramUniforms(SerialiserType *ser, CaptureState state, GLuin case eGL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY: case eGL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE: case eGL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY: - case eGL_UNSIGNED_INT_ATOMIC_COUNTER: case eGL_INT: case eGL_INT_VEC2: case eGL_INT_VEC3: