mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-30 02:13:30 +00:00
Dynamic indexes are limited to references to matrices and arrays https://github.com/gpuweb/gpuweb/pull/1801 Bug: tint:867 Change-Id: I114daa053c8a4ffd23ce784ac4538567a551cc21 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54701 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Sarah Mashayekhi <sarahmashay@google.com>
25 lines
629 B
Plaintext
25 lines
629 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct tint_symbol_1 {
|
|
float4 value [[position]];
|
|
};
|
|
struct tint_array_wrapper {
|
|
float2 arr[3];
|
|
};
|
|
struct tint_symbol_2 {
|
|
float4 value [[color(0)]];
|
|
};
|
|
|
|
vertex tint_symbol_1 vtx_main(uint VertexIndex [[vertex_id]]) {
|
|
tint_array_wrapper pos = {.arr={float2(0.0f, 0.5f), float2(-0.5f, -0.5f), float2(0.5f, -0.5f)}};
|
|
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;
|
|
}
|
|
|