mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
writer/hlsl: Don't wrap arrays in structures
FXC has trouble dealing with these. This was originally added to handle returning arrays as structures. HLSL supports typedefs, which is a much simpiler solution, and doesn't upset FXC. Bug: tint:848 Bug: tint:904 Change-Id: Ie841c9c454461a885a35c41476fd4d05d3f34cbf Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56774 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
106ac290e6
commit
4135ea55eb
@@ -4,14 +4,11 @@ struct tint_symbol_1 {
|
||||
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)};
|
||||
float2 pos[3] = {float2(0.0f, 0.5f), float2(-0.5f, -0.5f), float2(0.5f, -0.5f)};
|
||||
const tint_symbol_2 tint_symbol_4 = {float4(pos[VertexIndex], 0.0f, 1.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user