GLSL: fix isNormal.

(I know it's deprecated, I'm just being a completist.)

Bug: tint:1222
Change-Id: Ie7716d2f5dd2d2bd2245ba2b0fe7ed8705574de0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80141
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White
2022-02-11 14:35:14 +00:00
committed by Tint LUCI CQ
parent 723f999ac2
commit 6f9ac3524a
7 changed files with 92 additions and 166 deletions

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
builtins/gen/isNormal/863dcd.wgsl:28:25 warning: use of deprecated builtin
var res: vec4<bool> = isNormal(vec4<f32>());
^^^^^^^^
@@ -7,9 +5,9 @@ builtins/gen/isNormal/863dcd.wgsl:28:25 warning: use of deprecated builtin
#version 310 es
bvec4 tint_isNormal(vec4 param_0) {
uint4 exponent = asuint(param_0) & 0x7f80000;
uint4 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec4 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec4 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -29,20 +27,13 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint4' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es
precision mediump float;
bvec4 tint_isNormal(vec4 param_0) {
uint4 exponent = asuint(param_0) & 0x7f80000;
uint4 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec4 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec4 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -58,19 +49,12 @@ void main() {
fragment_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:5: 'uint4' : undeclared identifier
ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es
bvec4 tint_isNormal(vec4 param_0) {
uint4 exponent = asuint(param_0) & 0x7f80000;
uint4 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec4 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec4 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -87,10 +71,3 @@ void main() {
compute_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint4' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
builtins/gen/isNormal/b00ab1.wgsl:28:25 warning: use of deprecated builtin
var res: vec2<bool> = isNormal(vec2<f32>());
^^^^^^^^
@@ -7,9 +5,9 @@ builtins/gen/isNormal/b00ab1.wgsl:28:25 warning: use of deprecated builtin
#version 310 es
bvec2 tint_isNormal(vec2 param_0) {
uint2 exponent = asuint(param_0) & 0x7f80000;
uint2 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec2 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec2 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -29,20 +27,13 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint2' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es
precision mediump float;
bvec2 tint_isNormal(vec2 param_0) {
uint2 exponent = asuint(param_0) & 0x7f80000;
uint2 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec2 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec2 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -58,19 +49,12 @@ void main() {
fragment_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:5: 'uint2' : undeclared identifier
ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es
bvec2 tint_isNormal(vec2 param_0) {
uint2 exponent = asuint(param_0) & 0x7f80000;
uint2 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec2 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec2 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -87,10 +71,3 @@ void main() {
compute_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint2' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
builtins/gen/isNormal/c286b7.wgsl:28:25 warning: use of deprecated builtin
var res: vec3<bool> = isNormal(vec3<f32>());
^^^^^^^^
@@ -7,9 +5,9 @@ builtins/gen/isNormal/c286b7.wgsl:28:25 warning: use of deprecated builtin
#version 310 es
bvec3 tint_isNormal(vec3 param_0) {
uint3 exponent = asuint(param_0) & 0x7f80000;
uint3 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec3 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec3 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -29,20 +27,13 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint3' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es
precision mediump float;
bvec3 tint_isNormal(vec3 param_0) {
uint3 exponent = asuint(param_0) & 0x7f80000;
uint3 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec3 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec3 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -58,19 +49,12 @@ void main() {
fragment_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:5: 'uint3' : undeclared identifier
ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es
bvec3 tint_isNormal(vec3 param_0) {
uint3 exponent = asuint(param_0) & 0x7f80000;
uint3 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec3 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec3 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
@@ -87,10 +71,3 @@ void main() {
compute_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint3' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
builtins/gen/isNormal/c6e880.wgsl:28:19 warning: use of deprecated builtin
var res: bool = isNormal(1.0);
^^^^^^^^
@@ -7,8 +5,8 @@ builtins/gen/isNormal/c6e880.wgsl:28:19 warning: use of deprecated builtin
#version 310 es
bool tint_isNormal(float param_0) {
uint exponent = asuint(param_0) & 0x7f80000;
uint clamped = clamp(exponent, 0x0080000, 0x7f00000);
uint exponent = floatBitsToUint(param_0) & 0x7f80000u;
uint clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return clamped == exponent;
}
@@ -29,20 +27,12 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'asuint' : no matching overloaded function found
ERROR: 0:4: '=' : cannot convert from ' const float' to ' temp highp uint'
ERROR: 0:4: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
#version 310 es
precision mediump float;
bool tint_isNormal(float param_0) {
uint exponent = asuint(param_0) & 0x7f80000;
uint clamped = clamp(exponent, 0x0080000, 0x7f00000);
uint exponent = floatBitsToUint(param_0) & 0x7f80000u;
uint clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return clamped == exponent;
}
@@ -59,19 +49,11 @@ void main() {
fragment_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:5: 'asuint' : no matching overloaded function found
ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp mediump uint'
ERROR: 0:5: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
#version 310 es
bool tint_isNormal(float param_0) {
uint exponent = asuint(param_0) & 0x7f80000;
uint clamped = clamp(exponent, 0x0080000, 0x7f00000);
uint exponent = floatBitsToUint(param_0) & 0x7f80000u;
uint clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return clamped == exponent;
}
@@ -89,11 +71,3 @@ void main() {
compute_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'asuint' : no matching overloaded function found
ERROR: 0:4: '=' : cannot convert from ' const float' to ' temp highp uint'
ERROR: 0:4: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.

View File

@@ -1,5 +1,3 @@
SKIP: FAILED
builtins/repeated_use.wgsl:5:9 warning: use of deprecated builtin
_ = isNormal(vec4<f32>());
^^^^^^^^
@@ -51,26 +49,26 @@ builtins/repeated_use.wgsl:19:9 warning: use of deprecated builtin
#version 310 es
bvec4 tint_isNormal(vec4 param_0) {
uint4 exponent = asuint(param_0) & 0x7f80000;
uint4 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec4 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec4 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
bvec3 tint_isNormal_1(vec3 param_0) {
uint3 exponent = asuint(param_0) & 0x7f80000;
uint3 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec3 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec3 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
bvec2 tint_isNormal_2(vec2 param_0) {
uint2 exponent = asuint(param_0) & 0x7f80000;
uint2 clamped = clamp(exponent, 0x0080000, 0x7f00000);
return clamped == exponent;
uvec2 exponent = floatBitsToUint(param_0) & 0x7f80000u;
uvec2 clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return equal(clamped, exponent);
}
bool tint_isNormal_3(float param_0) {
uint exponent = asuint(param_0) & 0x7f80000;
uint clamped = clamp(exponent, 0x0080000, 0x7f00000);
uint exponent = floatBitsToUint(param_0) & 0x7f80000u;
uint clamped = clamp(exponent, 0x0080000u, 0x7f00000u);
return clamped == exponent;
}
@@ -95,10 +93,3 @@ void main() {
tint_symbol();
return;
}
Error parsing GLSL shader:
ERROR: 0:4: 'uint4' : undeclared identifier
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.