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

[glsl-out] Fix functions with array return type #2382

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

Gordon-F
Copy link
Collaborator

Fix #2380

Generated shader from #2380:

#version 310 es

precision highp float;
precision highp int;

layout(location = 0) out vec4 _fs2p_location0;

float[2] ret_array() {
    return float[2](1.0, 2.0);
}

void main() {
    float _e0[2] = ret_array();
    _fs2p_location0 = vec4(_e0[0], _e0[1], 0.0, 1.0);
    return;
}

Tested locally on modified wgpu hello-triangle example with OpenGL ES backend.

@teoxoy
Copy link
Member

teoxoy commented Jun 14, 2023

Thanks for the PR, it looks good!

Could you also add a test for this?

@Gordon-F
Copy link
Collaborator Author

Could you also add a test for this?

Sure. I added a new test, because gfx-rs/wgpu#4393 not fixed.

@teoxoy teoxoy merged commit f31093f into gfx-rs:master Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[glsl-out] Return type for returning arrays is incorrect
2 participants