mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 19:55:37 +00:00
Allow the resolver to understand builtin structures, like __frexp_result_f16. This allows backend transforms to declare the types, even if they're "untypable" by the user. Bug: chromium:1430309 Change-Id: I392709118182a058f737ccf1b7b46fc6b0b7264d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/129482 Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
27 lines
521 B
HLSL
27 lines
521 B
HLSL
struct frexp_result_f32_1 {
|
|
float fract;
|
|
int exp;
|
|
};
|
|
struct frexp_result_f32 {
|
|
float f;
|
|
};
|
|
|
|
static frexp_result_f32 a = (frexp_result_f32)0;
|
|
const frexp_result_f32_1 c = {0.5f, 1};
|
|
static frexp_result_f32_1 b = c;
|
|
|
|
struct tint_symbol {
|
|
float4 value : SV_Target0;
|
|
};
|
|
|
|
float4 main_inner() {
|
|
return float4(a.f, b.fract, 0.0f, 0.0f);
|
|
}
|
|
|
|
tint_symbol main() {
|
|
const float4 inner_result = main_inner();
|
|
tint_symbol wrapper_result = (tint_symbol)0;
|
|
wrapper_result.value = inner_result;
|
|
return wrapper_result;
|
|
}
|