mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-09 20:10:06 +00:00
ff6dcca575
If a uniform has an initializer it will now be given as the optional initializer operand to the OpVariable instruction. Fixes: https://github.com/KhronosGroup/glslang/issues/1259 Signed-off-by: Neil Roberts <nroberts@igalia.com> (the code) Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com> (the tests) Signed-off-by: Arcady Goldmints-Orlov <agoldmints@igalia.com> Co-authored-by: Neil Roberts <nroberts@igalia.com>
15 lines
270 B
GLSL
15 lines
270 B
GLSL
#version 450
|
|
|
|
layout (location = 0) out vec4 color;
|
|
|
|
layout (constant_id = 1) const float opacity = 0.5;
|
|
|
|
layout (location = 0) uniform vec3 in_color = vec3(1.0, 0.5, 0);
|
|
|
|
layout (location = 4) uniform float foo = opacity;
|
|
|
|
void main()
|
|
{
|
|
color = vec4(in_color, foo);
|
|
}
|