mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 11:45:54 +00:00
The HLSL `sign` method returns an `int` result (scalar or vector). The WGSL `sign` expects the result to be the same type as the argument. This CL injects a cast to the correct type after the `sign` call in the HLSL generated source. Bug: tint:1795 Change-Id: I51fed24b5b8b752b6b27fdfb5dd47eb803902793 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116692 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
32 lines
525 B
HLSL
32 lines
525 B
HLSL
void sign_dd790e() {
|
|
float arg_0 = 1.0f;
|
|
float res = float(sign(arg_0));
|
|
}
|
|
|
|
struct tint_symbol {
|
|
float4 value : SV_Position;
|
|
};
|
|
|
|
float4 vertex_main_inner() {
|
|
sign_dd790e();
|
|
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() {
|
|
sign_dd790e();
|
|
return;
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void compute_main() {
|
|
sign_dd790e();
|
|
return;
|
|
}
|