naga
naga copied to clipboard
[hlsl-out] Invalid HLSL for function which accepts a pointer to an array
WGSL:
var<private> c: array<i32, 1>;
fn f(e: ptr<private, array<i32, 1>>) {
(*e)[0] = 1;
}
@compute
@workgroup_size(1)
fn main() {
f(&c);
}
HLSL:
static int c[1] = {(int)0};
void f(inout int e)
{
e[0] = 1;
return;
}
[numthreads(1, 1, 1)]
void main()
{
f(c);
return;
}
This fails to compile with:
error X3121: array, matrix, vector, or indexable object type expected in index expression
Note that the argument type is an int
instead of an array.
This looks like it might be related to #1930.