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

Support RuntimeDescriptorArray when ingesting SPIR-V #6423

Open
hasenbanck opened this issue Oct 18, 2024 · 1 comment
Open

Support RuntimeDescriptorArray when ingesting SPIR-V #6423

hasenbanck opened this issue Oct 18, 2024 · 1 comment
Labels
area: naga front-end help required We need community help to make this happen. lang: SPIR-V Vulkan's Shading Language naga Shader Translator type: enhancement New feature or request

Comments

@hasenbanck
Copy link
Contributor

While testing "slang" as a shader language, I produced SPIR-V that contained unbound texture arrays (for which I would write a binding array in WGSL):

[[vk::binding(0, 2)]]
Texture2D textures[];

// WGSL equivelent:
// @group(2) @binding(0) var textures: binding_array<texture_2d<f32>>;

When compiling the shader with this SPIR-V using the include_spirv!() macro, I get the following validation error:

parsing error: UnsupportedCapability(RuntimeDescriptorArray)

It would be great if naga could ingest SPIR-V that use runtime descriptor arrays.

PS: When bounding the txture array, naga will happily accept the SPIR-V and wgpu will run the shader. Since it seems that wgpu does not properly do bounds checking, the shader will work as if it was boundless (which could be seens as kind of a workaround).

@teoxoy teoxoy added type: enhancement New feature or request naga Shader Translator lang: SPIR-V Vulkan's Shading Language area: naga front-end help required We need community help to make this happen. labels Oct 18, 2024
@cwfitzgerald
Copy link
Member

What wgpu version - I just tested adding that cap on trunk and it works fine. I do get a different error though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end help required We need community help to make this happen. lang: SPIR-V Vulkan's Shading Language naga Shader Translator type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants