mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-03 10:45:36 +00:00
No need for the HLSL-style repeated swizzle; GLSL allows construction of a vector from a scalar value of the component type. Bug: tint:1317 Change-Id: Ia0afe3012cbb56716a2d1c5c3849dd662a5ff89c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/70342 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
28 lines
485 B
GLSL
28 lines
485 B
GLSL
#version 310 es
|
|
precision mediump float;
|
|
|
|
struct tint_symbol {
|
|
vec4 value;
|
|
};
|
|
|
|
vec4 frag_main_inner() {
|
|
float b = 0.0f;
|
|
vec3 v = vec3(b);
|
|
return vec4(v, 1.0f);
|
|
}
|
|
|
|
tint_symbol frag_main() {
|
|
vec4 inner_result = frag_main_inner();
|
|
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
|
wrapper_result.value = inner_result;
|
|
return wrapper_result;
|
|
}
|
|
out vec4 value;
|
|
void main() {
|
|
tint_symbol outputs;
|
|
outputs = frag_main();
|
|
value = outputs.value;
|
|
}
|
|
|
|
|