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

ShaderValidation error: Not implemented: variable qualifier #5994

Open
wcork opened this issue Jul 19, 2024 · 0 comments
Open

ShaderValidation error: Not implemented: variable qualifier #5994

wcork opened this issue Jul 19, 2024 · 0 comments
Labels
area: naga front-end lang: GLSL OpenGL Shading Language lang: SPIR-V Vulkan's Shading Language naga Shader Translator type: enhancement New feature or request

Comments

@wcork
Copy link

wcork commented Jul 19, 2024

Description
wgpu - 22.0
naga/naga-cli - 22.0

I'm having interesting issues with implementing a shader for use with wgpu.

The basic concept is glsl -> glslc -> spv -> naga -> wgsl or import the spv files directly with the naga-backend.

During this process, I run into various errors when attempting to translate the shader.

If this is an storage type compatibility issue, is there a way to have naga explain which type?

Repro steps

spv created as follows:

glslc -fpreserve-bindings -fshader-stage=compute -I./ --target-spv=spv1.3 fsr3upscaler/ffx_fsr3upscaler_luma_pyramid_pass.glsl -o t/ffx_fsr3upscaler_luma_pyramid_pass.spv

This fails on the cli directly which produces the same error when calling create_shader_module in wgpu:

naga --shader-stage compute t/ffx_fsr3upscaler_luma_pyramid_pass.spv t/ffx_fsr3upscaler_luma_pyramid_pass.wgsl
unsupported storage class %11

This produces valid glsl:

spirv-cross --vulkan-semantics --version 450 t/ffx_fsr3upscaler_luma_pyramid_pass.spv --output t/ffx_fsr3upscaler_luma_pyramid_pass_cross.glsl

But when attempting to use naga:

naga --shader-stage compute t/ffx_fsr3upscaler_luma_pyramid_pass_cross.glsl t/ffx_fsr3upscaler_luma_pyramid_pass.wgsl
error: Not implemented: variable qualifier
   ┌─ ffx_fsr3upscaler_luma_pyramid_pass_cross.glsl:44:45
   │
44 │ layout(set = 0, binding = 9, rg16f) uniform coherent image2D rw_spd_mip5;
   │                                             ^^^^^^^^

I suspect this is an image compatibility issue? According to the SPIR-V spec here, %11 must be referring to an image.

Expected vs observed behavior
No errors vs having them

Extra materials
Zip containing the spv from glslc and the spirv-cross glsl
luma_shaders_cross.zip

Platform
Linux / Ubuntu

@teoxoy teoxoy added type: enhancement New feature or request naga Shader Translator lang: SPIR-V Vulkan's Shading Language area: naga front-end lang: GLSL OpenGL Shading Language labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end lang: GLSL OpenGL Shading Language 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

2 participants