naga icon indicating copy to clipboard operation
naga copied to clipboard

[hlsl-out] Invalid HLSL for function which returns an array

Open hasali19 opened this issue 2 years ago • 0 comments

WGSL:

fn f() -> array<i32, 1> {
    return array<i32, 1>();
}

HLSL:

typedef int ret_Constructarray1_int_[1];
ret_Constructarray1_int_ Constructarray1_int_(int arg0) {
    int ret[1] = { arg0 };
    return ret;
}

int f()
{
    return Constructarray1_int_(0);
}

Note that f returns a scalar int in the generated HLSL.

hasali19 avatar May 18 '22 15:05 hasali19