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

Fix for incorrect GLSL validation on witeonly image uniforms #2061

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spencerkohan
Copy link

Related to this issue: gfx-rs/wgpu#4530

I noticed the validation on layout qualifiers for writeonly image uniforms was not working according to the GLSL spec.

I saw there was already a TODO in the code, and the fix seemed straightforward so I made a PR for this.

@JCapucho
Copy link
Collaborator

Thanks for trying to fix the issue, but unfortunately this doesn't solve the underlying problem it just side steps the error gating it.

The problem is that naga doesn't have a way to express a storage image without a format, so we initialize it by default r8uint and expect the user to change the format.

let class = ImageClass::Storage {
format: crate::StorageFormat::R8Uint,
access: crate::StorageAccess::all(),
};

So your solution is just making all writeonly images without storage format default to r8uint.

Also if try this on the original issue reproduction case, it won't work, because the storage format kind and the data vector kind aren't equal.

@spencerkohan
Copy link
Author

Ok I see the problem. Would this be somehow solvable by making format optional on ImageClass::Storage, or is there a hard requirement to have the format later on?

I am wondering how spriv-cross solves this problem.

@JCapucho
Copy link
Collaborator

That would be a possibility, but the real problem is figuring out how to handle it in the backends.

So I recommend you first research how this would map to the different backends and then we can discuss how this would map to the IR.

Copy link
Collaborator

@JCapucho JCapucho left a comment

Choose a reason for hiding this comment

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

Forgot to mark it as requesting changes

@cwfitzgerald
Copy link
Member

Hello, thank you for your PR against Naga!

As part of gfx-rs/wgpu#4231, we have moved development of Naga into the wgpu repository in the Naga subfolder. We have transferred all issues, but we are unable to automatically transfer PRs.

As such, please recreate your PR against the wgpu repository. We apologize for the inconvenience this causes, but will make contributing to both projects more streamlined going forward.

We are leaving PRs open, but once they are transferred, please close the original Naga PR.

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.

3 participants