tint/hlsl: don't use min16float to implement quantizeToF16

min16float is not required to convert its input to an 16-bit float.
Instead, use f32tof16, and f16tof32.

This is also required to be able to enable the IEEE strictness option on
FXC, otherwise FXC emits an error X4028: expression has a minimum
precision type and cannot be marked precise

Bug: tint:1887
Change-Id: I2268c9336b8e873b36e6532984838054fe4dedbd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125920
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Antonio Maiorano
2023-03-31 08:00:33 +00:00
committed by Dawn LUCI CQ
parent 73f2405304
commit 51249b83e6
10 changed files with 13 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_12e50e() {
float arg_0 = 1.0f;
float res = float(min16float(arg_0));
float res = f16tof32(f32tof16(arg_0));
prevent_dce.Store(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_12e50e() {
float arg_0 = 1.0f;
float res = float(min16float(arg_0));
float res = f16tof32(f32tof16(arg_0));
prevent_dce.Store(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_2cddf3() {
float2 arg_0 = (1.0f).xx;
float2 res = float2(min16float2(arg_0));
float2 res = f16tof32(f32tof16(arg_0));
prevent_dce.Store2(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_2cddf3() {
float2 arg_0 = (1.0f).xx;
float2 res = float2(min16float2(arg_0));
float2 res = f16tof32(f32tof16(arg_0));
prevent_dce.Store2(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_cba294() {
float4 arg_0 = (1.0f).xxxx;
float4 res = float4(min16float4(arg_0));
float4 res = f16tof32(f32tof16(arg_0));
prevent_dce.Store4(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_cba294() {
float4 arg_0 = (1.0f).xxxx;
float4 res = float4(min16float4(arg_0));
float4 res = f16tof32(f32tof16(arg_0));
prevent_dce.Store4(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_e8fd14() {
float3 arg_0 = (1.0f).xxx;
float3 res = float3(min16float3(arg_0));
float3 res = f16tof32(f32tof16(arg_0));
prevent_dce.Store3(0u, asuint(res));
}

View File

@@ -2,7 +2,7 @@ RWByteAddressBuffer prevent_dce : register(u0, space2);
void quantizeToF16_e8fd14() {
float3 arg_0 = (1.0f).xxx;
float3 res = float3(min16float3(arg_0));
float3 res = f16tof32(f32tof16(arg_0));
prevent_dce.Store3(0u, asuint(res));
}