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

Unable to break out of the loop in SPIR-V #6220

Open
kvark opened this issue Sep 5, 2024 · 0 comments
Open

Unable to break out of the loop in SPIR-V #6220

kvark opened this issue Sep 5, 2024 · 0 comments
Labels
area: naga back-end Outputs of naga shader conversion lang: SPIR-V Vulkan's Shading Language naga Shader Translator type: bug Something isn't working

Comments

@kvark
Copy link
Member

kvark commented Sep 5, 2024

Description
Getting invalid SPIR-V out of Naga:

error: line 36: Block '23[%23]' branches to the loop continue target '16[%16]', but is not contained in the associated loop construct '13[%13]'
OpBranch %16

Repro steps
Program:

fn main() {
    for (var i = 0; i < 4; i += 1) {
      break;
    }
}

Expected vs observed behavior
Expected to produce valid SPIR-V

@kvark kvark added type: bug Something isn't working area: naga back-end Outputs of naga shader conversion naga Shader Translator lang: SPIR-V Vulkan's Shading Language labels Sep 5, 2024
@kvark kvark changed the title Unable to break out of the loop in SPIR-V Simple for loop produces invalid SPIR-V Sep 5, 2024
@kvark kvark changed the title Simple for loop produces invalid SPIR-V Unable to break out of the loop in SPIR-V Sep 5, 2024
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: SPIR-V Vulkan's Shading Language naga Shader Translator type: bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

1 participant