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

Validate vertex entry point returns the position built-in #2264

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Mar 3, 2023

Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if it was right to enforce this on all modules, not just those derived from WGSL. But:

  • GLSL says the vertex position is undefined if the vertex shader doesn't assign to gl_Position, so it seems like any vertex shader that doesn't do so should probably be flagged by Naga.

  • I can't find anything in the Vulkan or SPIR-V specifications that justifies enforcing this rule on SPIR-V input, but I also don't see the harm.

So, I guess we might as well go with this and see if anyone complains. Thanks for updating all the tests.

I think there's a better way to do the check.

src/valid/interface.rs Outdated Show resolved Hide resolved
src/valid/interface.rs Show resolved Hide resolved
src/valid/interface.rs Show resolved Hide resolved
src/valid/interface.rs Outdated Show resolved Hide resolved
tests/snapshots.rs Show resolved Hide resolved
tests/out/wgsl/binop-frag.wgsl Outdated Show resolved Hide resolved
tests/out/glsl/multiview.main.Fragment.glsl Outdated Show resolved Hide resolved
@gfx-rs gfx-rs deleted a comment from codecov-commenter Apr 12, 2023
Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jimblandy jimblandy merged commit b9c5cb5 into gfx-rs:master Apr 12, 2023
@teoxoy teoxoy deleted the valid-vertex-return branch April 13, 2023 06:53
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.

Segfault in create_render_pipeline when vertex shader returns void
2 participants