mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 12:15:43 +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>
30 lines
1.0 KiB
Plaintext
30 lines
1.0 KiB
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct Output {
|
|
float4 Position;
|
|
float4 color;
|
|
};
|
|
struct tint_symbol_2 {
|
|
float4 color [[user(locn0)]];
|
|
float4 Position [[position]];
|
|
};
|
|
struct tint_array_wrapper_0 {
|
|
float2 array[4];
|
|
};
|
|
struct tint_array_wrapper_1 {
|
|
float4 array[4];
|
|
};
|
|
|
|
vertex tint_symbol_2 tint_symbol(uint VertexIndex [[vertex_id]], uint InstanceIndex [[instance_id]]) {
|
|
tint_array_wrapper_0 const zv = {float2(0.200000003f, 0.200000003f), float2(0.300000012f, 0.300000012f), float2(-0.100000001f, -0.100000001f), float2(1.100000024f, 1.100000024f)};
|
|
float const z = zv.array[InstanceIndex].x;
|
|
Output output = {};
|
|
output.Position = float4(0.5f, 0.5f, z, 1.0f);
|
|
tint_array_wrapper_1 const colors = {float4(1.0f, 0.0f, 0.0f, 1.0f), float4(0.0f, 1.0f, 0.0f, 1.0f), float4(0.0f, 0.0f, 1.0f, 1.0f), float4(1.0f, 1.0f, 1.0f, 1.0f)};
|
|
output.color = colors.array[InstanceIndex];
|
|
tint_symbol_2 const tint_symbol_3 = {.color=output.color, .Position=output.Position};
|
|
return tint_symbol_3;
|
|
}
|
|
|