mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-03 13:11:34 +00:00
This patch implement modf and frexp built-ins for f16 types, and also simplify their implementation for f32 in MSL and HLSL, and clean up deprecated code in GLSL writer. Corresponding unittests are also implemented, but end-to-end tests for f16 are not implemented yet. Bug: tint:1473, tint:1502 Change-Id: I12887ae5303c6dc032a51f619e1afeb19b4603b6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98102 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com> Reviewed-by: Ben Clayton <bclayton@google.com>
41 lines
715 B
HLSL
41 lines
715 B
HLSL
struct modf_result_vec2 {
|
|
float2 fract;
|
|
float2 whole;
|
|
};
|
|
modf_result_vec2 tint_modf(float2 param_0) {
|
|
modf_result_vec2 result;
|
|
result.fract = modf(param_0, result.whole);
|
|
return result;
|
|
}
|
|
|
|
void modf_2d50da() {
|
|
modf_result_vec2 res = tint_modf((1.0f).xx);
|
|
}
|
|
|
|
struct tint_symbol {
|
|
float4 value : SV_Position;
|
|
};
|
|
|
|
float4 vertex_main_inner() {
|
|
modf_2d50da();
|
|
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() {
|
|
modf_2d50da();
|
|
return;
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void compute_main() {
|
|
modf_2d50da();
|
|
return;
|
|
}
|