Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hasali19 opened this issue May 18, 2022 · 1 comment
Open

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

hasali19 opened this issue May 18, 2022 · 1 comment
Labels
area: naga back-end Outputs of naga shader conversion lang: HLSL D3D Shading Language naga Shader Translator type: bug Something isn't working

Comments

@hasali19
Copy link
Contributor

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.

@jimblandy
Copy link
Member

Reproduced on recent trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion lang: HLSL D3D Shading Language naga Shader Translator type: bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

4 participants