From bf5980b6e9a6002c7e0f377a361cf64465d55382 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 21 Feb 2015 22:04:30 +0000 Subject: [PATCH] Make sure glCreateShaderProgramv creates a re-linkable sep program * We have a separable program for each shader that we can use to mess about with and relink for doing overlay/analysis type stuff. We need to make sure we create it properly and don't use re-use the separable program that is the 'real' version. --- renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp index 7a308db88..ce35215ae 100644 --- a/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp @@ -330,6 +330,9 @@ bool WrappedOpenGL::Serialise_glCreateShaderProgramv(GLuint program, GLenum type sources[i] = &src[i][0]; GLuint real = m_Real.glCreateShaderProgramv(Type, Count, sources); + // we want a separate program that we can mess about with for making overlays + // and relink without having to worry about restoring the 'real' program state. + GLuint sepprog = MakeSeparableShaderProgram(m_Real, Type, src, NULL); delete[] sources; @@ -349,7 +352,7 @@ bool WrappedOpenGL::Serialise_glCreateShaderProgramv(GLuint program, GLenum type shadDetails.type = Type; shadDetails.sources.swap(src); - shadDetails.prog = real; + shadDetails.prog = sepprog; MakeShaderReflection(m_Real, Type, real, shadDetails.reflection, pointSizeUsed, clipDistanceUsed); create_array_uninit(shadDetails.reflection.DebugInfo.files, shadDetails.sources.size());