Does GLSL remove unused variables?

Viewed 792

For example, my vertex shader:

...
attribute vec2 uTexCoord;
uniform float a, b, c;
out vec2 texCoord;
...
void main() {
    ...
    texCoord = uTexCoord * a * b * c;
    ...
}

And my fragment shader:

...
in vec2 texCoord;
uniform vec4 color;
layout(location = 0) out vec4 fragColor;
...
void main() {
    ...
    fragColor = color;

}

Which variables will be considered unnecessary and will be deleted?

Or better to use #ifdef to exclude such code portions?

0 Answers
Related