Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface block identifiers renamed inconsistently across multiple files #430

Closed
martiancatboy opened this issue Jul 15, 2024 · 0 comments
Closed

Comments

@martiancatboy
Copy link

I'm having an issue where identifiers in interface blocks receive different names across multiple files. This trips up my video driver's GLSL compiler, which apparently expects interface blocks to be identical across all stages of a shader program.

The simplest way I've found to reproduce the bug is by creating a file with a single block in it:

echo "uniform U { vec4 v; };" > bug.glsl

and then passing it multiple times to shader_minifier:

mono shader_minifier.exe bug.glsl bug.glsl bug.glsl

The output on my machine is

// Generated with Shader Minifier 1.4.0 (https://github.com/laurentlb/Shader_Minifier/)
#ifndef SHADER_CODE_H_
# define SHADER_CODE_H_

const char *bug_glsl =
 "uniform U{vec4 U;};";

const char *bug_glsl =
 "uniform U{vec4 K;};";

const char *bug_glsl =
 "uniform U{vec4 J;};";

#endif // SHADER_CODE_H_

The expected behavior is that U, K, and J would receive the same name everywhere. (Please ignore the fact that the output contains the identifier bug_glsl three times, which obviously wouldn't compile.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant