dawn-cmake/test/array/function_parameter.wgsl.expected.hlsl
Ben Clayton 4135ea55eb 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>
2021-07-05 15:20:57 +00:00

23 lines
393 B
HLSL

float f1(float a[4]) {
return a[3];
}
float f2(float a[3][4]) {
return a[2][3];
}
float f3(float a[2][3][4]) {
return a[1][2][3];
}
[numthreads(1, 1, 1)]
void main() {
const float a1[4] = (float[4])0;
const float a2[3][4] = (float[3][4])0;
const float a3[2][3][4] = (float[2][3][4])0;
const float v1 = f1(a1);
const float v2 = f2(a2);
const float v3 = f3(a3);
return;
}