mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-05 20:55:58 +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>
26 lines
654 B
HLSL
26 lines
654 B
HLSL
struct tint_symbol_1 {
|
|
uint VertexIndex : SV_VertexID;
|
|
};
|
|
struct tint_symbol_2 {
|
|
float4 value : SV_Position;
|
|
};
|
|
struct tint_array_wrapper {
|
|
float2 arr[3];
|
|
};
|
|
|
|
tint_symbol_2 vtx_main(tint_symbol_1 tint_symbol) {
|
|
const uint VertexIndex = tint_symbol.VertexIndex;
|
|
tint_array_wrapper pos = {{float2(0.0f, 0.5f), float2(-0.5f, -0.5f), float2(0.5f, -0.5f)}};
|
|
const tint_symbol_2 tint_symbol_4 = {float4(pos.arr[VertexIndex], 0.0f, 1.0f)};
|
|
return tint_symbol_4;
|
|
}
|
|
|
|
struct tint_symbol_3 {
|
|
float4 value : SV_Target0;
|
|
};
|
|
|
|
tint_symbol_3 frag_main() {
|
|
const tint_symbol_3 tint_symbol_5 = {float4(1.0f, 0.0f, 0.0f, 1.0f)};
|
|
return tint_symbol_5;
|
|
}
|