mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-15 01:26:06 +00:00
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>
35 lines
663 B
HLSL
35 lines
663 B
HLSL
RWByteAddressBuffer prevent_dce : register(u0, space2);
|
|
|
|
void quantizeToF16_12e50e() {
|
|
float arg_0 = 1.0f;
|
|
float res = f16tof32(f32tof16(arg_0));
|
|
prevent_dce.Store(0u, asuint(res));
|
|
}
|
|
|
|
struct tint_symbol {
|
|
float4 value : SV_Position;
|
|
};
|
|
|
|
float4 vertex_main_inner() {
|
|
quantizeToF16_12e50e();
|
|
return (0.0f).xxxx;
|
|
}
|
|
|
|
tint_symbol vertex_main() {
|
|
const float4 inner_result = vertex_main_inner();
|
|
tint_symbol wrapper_result = (tint_symbol)0;
|
|
wrapper_result.value = inner_result;
|
|
return wrapper_result;
|
|
}
|
|
|
|
void fragment_main() {
|
|
quantizeToF16_12e50e();
|
|
return;
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void compute_main() {
|
|
quantizeToF16_12e50e();
|
|
return;
|
|
}
|