mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-02 12:41:36 +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>
45 lines
757 B
Plaintext
45 lines
757 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
|
|
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(float2(1.0f));
|
|
}
|
|
|
|
struct tint_symbol {
|
|
float4 value [[position]];
|
|
};
|
|
|
|
float4 vertex_main_inner() {
|
|
modf_2d50da();
|
|
return float4(0.0f);
|
|
}
|
|
|
|
vertex tint_symbol vertex_main() {
|
|
float4 const inner_result = vertex_main_inner();
|
|
tint_symbol wrapper_result = {};
|
|
wrapper_result.value = inner_result;
|
|
return wrapper_result;
|
|
}
|
|
|
|
fragment void fragment_main() {
|
|
modf_2d50da();
|
|
return;
|
|
}
|
|
|
|
kernel void compute_main() {
|
|
modf_2d50da();
|
|
return;
|
|
}
|
|
|