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

Combined capability flags are limiting #2158

Closed
zakarumych opened this issue Jun 14, 2022 · 8 comments
Closed

Combined capability flags are limiting #2158

zakarumych opened this issue Jun 14, 2022 · 8 comments
Labels

Comments

@zakarumych
Copy link
Contributor

I have a shader that need to do non-uniform indexing into array of sampled images.
Vulkan extension supports non-uniform indexing into image arrays (both sampled and storage) and does not support non-uniform indexing of buffer arrays.

Naga has this capability flag - SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING
For some reason sampled texture and storage buffer arrays non-uniform indexing live under one flag.
And UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING combines uniform buffer and storage texture arrays indexing.
This looks especially weird since flags combine different opposite kinds of buffer and texture arrays.

Due to those peculiar combinations I can't enable either of the flags on my machine.
In turn I can't validate my wgsl shader without dirty hacks.

@cwfitzgerald
Copy link
Member

To answer why the flags are combined, we couldn't find any machines during our initial investigation where they had one of the flag but not another. Do you have a machine with a feature partly supported? If so which machine (got a vulkan.gpuinfo report?)

@cwfitzgerald cwfitzgerald transferred this issue from gfx-rs/naga Jun 14, 2022
@cwfitzgerald
Copy link
Member

Moved to wgpu because Naga just follows wgpu here.

@zakarumych
Copy link
Contributor Author

Here's vulkaninfo output
As you can guess. It's actually Metal wrapped in MoltenVK.

@cwfitzgerald
Copy link
Member

I'm not sure if we really should accommodate MoltenVK considering the metal backend now supports descriptor indexing natively.

@zakarumych
Copy link
Contributor Author

Some software works with Vulkan API and for now MoltenVK is the only maintained project that emulates Vulkan on Apple OSes.
Do you suggest not using naga in this case?

@cwfitzgerald
Copy link
Member

Is your use case using Naga for a non-wgpu application? It's definitely worthwhile to split it in Naga then, splitting it in wgpu is a bit of a bigger question, but this has come up before that whatever flags we use, some of them are wrong

@zakarumych
Copy link
Contributor Author

Yes, I use naga as shader compiler for my Vulkan based graphics API, to accept shaders in whatever language and transform them to spir-V.

@teoxoy teoxoy transferred this issue from gfx-rs/wgpu Dec 8, 2022
@teoxoy
Copy link
Member

teoxoy commented Dec 8, 2022

Moved this back to naga, will be addressed once we get to gfx-rs/wgpu#4407. PRs are also welcome :)

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants