tint: HLSL and GLSL backends now emit 0 for inf and nan

Bug: tint:1581
Change-Id: I62dcde177c3b82408cd8d737526d10d481b48a17
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101240
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano
2022-09-03 21:43:01 +00:00
committed by Dawn LUCI CQ
parent 1741f4443e
commit 679cf4f351
14 changed files with 36 additions and 38 deletions

View File

@@ -14,7 +14,7 @@ float getAAtOutCoords_() {
float unaryOperation_f1_(inout float a) {
const float x_47 = a;
if ((x_47 < 0.0f)) {
return asfloat(0x7f800000u);
return 0.0f /* inf */;
}
const float x_55 = a;
return log(x_55);

View File

@@ -14,7 +14,7 @@ float getAAtOutCoords_() {
float unaryOperation_f1_(inout float a) {
const float x_47 = a;
if ((x_47 < 0.0f)) {
return asfloat(0x7f800000u);
return 0.0f /* inf */;
}
const float x_55 = a;
return log(x_55);

View File

@@ -26,7 +26,7 @@ float getAAtOutCoords_() {
float unaryOperation_f1_(inout float a) {
float x_47 = a;
if ((x_47 < 0.0f)) {
return uintBitsToFloat(0x7f800000u);
return 0.0f /* inf */;
}
float x_55 = a;
return log(x_55);

View File

@@ -1,7 +1,7 @@
static float4 out_var_SV_TARGET = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = (asfloat(0xff800000u)).xxxx;
out_var_SV_TARGET = (0.0f /* -inf */).xxxx;
return;
}

View File

@@ -1,7 +1,7 @@
static float4 out_var_SV_TARGET = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = (asfloat(0xff800000u)).xxxx;
out_var_SV_TARGET = (0.0f /* -inf */).xxxx;
return;
}

View File

@@ -4,7 +4,7 @@ precision mediump float;
layout(location = 0) out vec4 out_var_SV_TARGET_1_1;
vec4 out_var_SV_TARGET = vec4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = vec4(uintBitsToFloat(0xff800000u));
out_var_SV_TARGET = vec4(0.0f /* -inf */);
return;
}

View File

@@ -1,7 +1,7 @@
static float4 out_var_SV_TARGET = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = (asfloat(0x7f800000u)).xxxx;
out_var_SV_TARGET = (0.0f /* inf */).xxxx;
return;
}

View File

@@ -1,7 +1,7 @@
static float4 out_var_SV_TARGET = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = (asfloat(0x7f800000u)).xxxx;
out_var_SV_TARGET = (0.0f /* inf */).xxxx;
return;
}

View File

@@ -4,7 +4,7 @@ precision mediump float;
layout(location = 0) out vec4 out_var_SV_TARGET_1_1;
vec4 out_var_SV_TARGET = vec4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = vec4(uintBitsToFloat(0x7f800000u));
out_var_SV_TARGET = vec4(0.0f /* inf */);
return;
}

View File

@@ -1,7 +1,7 @@
static float4 out_var_SV_TARGET = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = float4(asfloat(0x7fc00000u), asfloat(0x7fc00000u), asfloat(0x7fc00000u), asfloat(0x7fc00000u));
out_var_SV_TARGET = float4(0.0f /* nan */, 0.0f /* nan */, 0.0f /* nan */, 0.0f /* nan */);
return;
}

View File

@@ -1,7 +1,7 @@
static float4 out_var_SV_TARGET = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = float4(asfloat(0x7fc00000u), asfloat(0x7fc00000u), asfloat(0x7fc00000u), asfloat(0x7fc00000u));
out_var_SV_TARGET = float4(0.0f /* nan */, 0.0f /* nan */, 0.0f /* nan */, 0.0f /* nan */);
return;
}

View File

@@ -4,7 +4,7 @@ precision mediump float;
layout(location = 0) out vec4 out_var_SV_TARGET_1_1;
vec4 out_var_SV_TARGET = vec4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
out_var_SV_TARGET = vec4(uintBitsToFloat(0x7fc00000u), uintBitsToFloat(0x7fc00000u), uintBitsToFloat(0x7fc00000u), uintBitsToFloat(0x7fc00000u));
out_var_SV_TARGET = vec4(0.0f /* nan */, 0.0f /* nan */, 0.0f /* nan */, 0.0f /* nan */);
return;
}