GLSL: fix single-valued vector init.

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>
This commit is contained in:
Stephen White
2021-11-22 16:14:16 +00:00
committed by Tint LUCI CQ
parent 177e7bfa5d
commit 7368e287dc
8 changed files with 34 additions and 93 deletions

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es
precision mediump float;
@@ -14,17 +12,17 @@ void tint_symbol() {
uint u32_var1 = uint(123);
uint u32_var2 = uint(123.0f);
uint u32_var3 = uint(true);
bvec3 v3bool_var1 = bvec3(uvec3((123u).xxx));
bvec3 v3bool_var11 = bvec3(uvec3((1234u).xxx));
bvec3 v3bool_var2 = bvec3(ivec3((123).xxx));
bvec3 v3bool_var3 = bvec3(vec3((123.0f).xxx));
ivec3 v3i32_var1 = ivec3(uvec3((123u).xxx));
ivec3 v3i32_var2 = ivec3(vec3((123.0f).xxx));
ivec3 v3i32_var3 = ivec3(bvec3((true).xxx));
uvec3 v3u32_var1 = uvec3(ivec3((123).xxx));
uvec3 v3u32_var2 = uvec3(vec3((123.0f).xxx));
uvec3 v3u32_var3 = uvec3(bvec3((true).xxx));
bvec3 v3bool_var4 = bvec3(bvec2(vec2((123.0f).xx)), true);
bvec3 v3bool_var1 = bvec3(uvec3(123u));
bvec3 v3bool_var11 = bvec3(uvec3(1234u));
bvec3 v3bool_var2 = bvec3(ivec3(123));
bvec3 v3bool_var3 = bvec3(vec3(123.0f));
ivec3 v3i32_var1 = ivec3(uvec3(123u));
ivec3 v3i32_var2 = ivec3(vec3(123.0f));
ivec3 v3i32_var3 = ivec3(bvec3(true));
uvec3 v3u32_var1 = uvec3(ivec3(123));
uvec3 v3u32_var2 = uvec3(vec3(123.0f));
uvec3 v3u32_var3 = uvec3(bvec3(true));
bvec3 v3bool_var4 = bvec3(bvec2(vec2(123.0f)), true);
bvec4 v4bool_var5 = bvec4(bvec2(vec2(123.0f, 0.0f)), bvec2(true, bool(float(0.0f))));
return;
}
@@ -33,10 +31,3 @@ void main() {
}
Error parsing GLSL shader:
ERROR: 0:15: 'scalar swizzle' : not supported with this profile: es
ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es
precision mediump float;
@@ -12,16 +10,16 @@ int i32_var3 = int(true);
uint u32_var1 = uint(1);
uint u32_var2 = uint(1.0f);
uint u32_var3 = uint(true);
bvec3 v3bool_var1 = bvec3(uvec3((1u).xxx));
bvec3 v3bool_var2 = bvec3(ivec3((1).xxx));
bvec3 v3bool_var3 = bvec3(vec3((1.0f).xxx));
ivec3 v3i32_var1 = ivec3(uvec3((1u).xxx));
ivec3 v3i32_var2 = ivec3(vec3((1.0f).xxx));
ivec3 v3i32_var3 = ivec3(bvec3((true).xxx));
uvec3 v3u32_var1 = uvec3(ivec3((1).xxx));
uvec3 v3u32_var2 = uvec3(vec3((1.0f).xxx));
uvec3 v3u32_var3 = uvec3(bvec3((true).xxx));
bvec3 v3bool_var4 = bvec3(bvec2(vec2((123.0f).xx)), true);
bvec3 v3bool_var1 = bvec3(uvec3(1u));
bvec3 v3bool_var2 = bvec3(ivec3(1));
bvec3 v3bool_var3 = bvec3(vec3(1.0f));
ivec3 v3i32_var1 = ivec3(uvec3(1u));
ivec3 v3i32_var2 = ivec3(vec3(1.0f));
ivec3 v3i32_var3 = ivec3(bvec3(true));
uvec3 v3u32_var1 = uvec3(ivec3(1));
uvec3 v3u32_var2 = uvec3(vec3(1.0f));
uvec3 v3u32_var3 = uvec3(bvec3(true));
bvec3 v3bool_var4 = bvec3(bvec2(vec2(123.0f)), true);
bvec4 v4bool_var5 = bvec4(bvec2(vec2(123.0f, 0.0f)), bvec2(true, bool(float(0.0f))));
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
@@ -53,10 +51,3 @@ void main() {
}
Error parsing GLSL shader:
ERROR: 0:13: 'scalar swizzle' : not supported with this profile: es
ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.