Skip to content

Commit 093630e

Browse files
committed
Try to override custom shader legacy redeclarations. Closes #3616
* When patching shaders for separability we are limited in what we can safely do. If we need to add a separable declaration but a shader uses legacy GLSL and redeclares an individual global these can't co-exist, so we try to remove the incompatible one. This may not be safe but is a best-effort.
1 parent 3aaf08c commit 093630e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

renderdoc/driver/gl/gl_shader_refl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,13 @@ GLuint MakeSeparableShaderProgram(WrappedOpenGL &drv, GLenum type, const rdcarra
293293
src.assign(outstr.c_str(), outstr.size());
294294
}
295295

296+
int idx = src.find("\nout float gl_CullDistance");
297+
if(idx > 0)
298+
src.insert(idx + 1, "//");
299+
idx = src.find("\nout float gl_ClipDistance");
300+
if(idx > 0)
301+
src.insert(idx + 1, "//");
302+
296303
if(!success)
297304
{
298305
RDCLOG("glslang failed:\n\n%s\n\n%s", sh.getInfoLog(), sh.getInfoDebugLog());

0 commit comments

Comments
 (0)