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

[msl-out] Shadowed variables are not allowed and so need to be renamed #1057

Closed
superdump opened this issue Jul 1, 2021 · 5 comments
Closed
Labels
area: back-end Outputs of shader conversion kind: bug Something isn't working lang: Metal Metal Shading Language

Comments

@superdump
Copy link
Contributor

It seems in wgsl that shadowing of variables is allowed, something like:

let a: u8 = 1;
let a: f32 = 1.0;

This works fine when running with the Vulkan backend, but metal does not support this shadowing of variables and so the variables will need to be renamed.

@munrocket
Copy link

This is legal operation in WGSL?

@kvark
Copy link
Member

kvark commented Jul 2, 2021

No, it's not legal. Closing as dupe of #1044

@kvark kvark closed this as completed Jul 2, 2021
@kvark
Copy link
Member

kvark commented Jul 2, 2021

I'm surprised MSL outputs this, actually. It uses the Namer to assign unique names 🤔
So may be a bug in msl-out.

@kvark kvark reopened this Jul 2, 2021
@teoxoy
Copy link
Member

teoxoy commented Apr 29, 2022

The msl output is correct (no duplicates) as of current master. I tried to reproduce the issue with all released versions of naga without success.

@superdump do you still have this issue? There might be something else that's not working.

@teoxoy teoxoy added kind: bug Something isn't working lang: Metal Metal Shading Language area: back-end Outputs of shader conversion labels Apr 29, 2022
@teoxoy
Copy link
Member

teoxoy commented Jun 16, 2022

Let's close this for now, feel free to reopen if the issue is still present.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: back-end Outputs of shader conversion kind: bug Something isn't working lang: Metal Metal Shading Language
Projects
None yet
Development

No branches or pull requests

4 participants