mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-12 21:20: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>
20 lines
368 B
GLSL
20 lines
368 B
GLSL
#version 450
|
|
|
|
layout (location = 0) out vec4 color;
|
|
|
|
layout (location = 0) uniform struct {
|
|
float r;
|
|
float g;
|
|
float b;
|
|
} parts[2] = { { 1.0, 1.0, 1.0}, { 0.0, 1.0, 0.0 } };
|
|
|
|
void main() {
|
|
color = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
color.r += parts[i].r;
|
|
color.g += parts[i].g;
|
|
color.b += parts[i].b;
|
|
}
|
|
}
|