mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-03 18:55:39 +00:00
And replace the MSL writer's logic to do this with the transform. We need to do the same thing in HLSL, and in the future GLSL too. Partially reverts fbfde720 Change-Id: Ie280e011bc3ded8e15ccacc0aeb12da3c2407389 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54242 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
25 lines
636 B
Plaintext
25 lines
636 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct tint_array_wrapper {
|
|
float2 arr[3];
|
|
};
|
|
struct tint_symbol_1 {
|
|
float4 value [[position]];
|
|
};
|
|
struct tint_symbol_2 {
|
|
float4 value [[color(0)]];
|
|
};
|
|
|
|
constant tint_array_wrapper pos = {.arr={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.arr[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;
|
|
}
|
|
|