mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-09 14:45:58 +00:00
Add a config parameter for the CanonicalizeEntryPoint transform that selects between emitting builtins as parameters (for MSL) or struct members (for HLSL). This fixes all of the shader IO issues in Tint's E2E tests for MSL. Fixed: tint:817 Change-Id: Ieb31cdbd2e4d96ac41f8d8515fd07ead8241d770 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53282 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com>
25 lines
637 B
Plaintext
25 lines
637 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct tint_symbol_1 {
|
|
float4 value [[position]];
|
|
};
|
|
struct tint_symbol_2 {
|
|
float4 value [[color(0)]];
|
|
};
|
|
struct tint_array_wrapper_0 {
|
|
float2 array[3];
|
|
};
|
|
|
|
constant tint_array_wrapper_0 pos = {float2(0.0f, 0.5f), float2(-0.5f, -0.5f), float2(0.5f, -0.5f)};
|
|
vertex tint_symbol_1 vtx_main(uint VertexIndex [[vertex_id]]) {
|
|
tint_symbol_1 const tint_symbol_3 = {.value=float4(pos.array[VertexIndex], 0.0f, 1.0f)};
|
|
return tint_symbol_3;
|
|
}
|
|
|
|
fragment tint_symbol_2 frag_main() {
|
|
tint_symbol_2 const tint_symbol_4 = {.value=float4(1.0f, 0.0f, 0.0f, 1.0f)};
|
|
return tint_symbol_4;
|
|
}
|
|
|