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

Shaders should not implicitly enable VulkanMemoryModel #1090

Open
Firestar99 opened this issue Aug 10, 2023 · 1 comment
Open

Shaders should not implicitly enable VulkanMemoryModel #1090

Firestar99 opened this issue Aug 10, 2023 · 1 comment
Labels
t: bug Something isn't working

Comments

@Firestar99
Copy link

Firestar99 commented Aug 10, 2023

Expected Behaviour

rust-gpu compiling for any spirv-unknown-vulkan1.X target should not implicitly emit OpCapability VulkanMemoryModel in the resulting spv, instead one would need to call SpirvBuilder.capability(Capability::VulkanMemoryModel) to enable the VulkanMemoryModel explicitly.
This implicit enabling of that Capability can get in the way of 1:1 porting of glsl shaders to rust-gpu, as it also requires changes to the CPU code to enable the VulkanMemoryModel device feature. Switching to target spirv-unknown-spv1.X does remove the implicit capability from the shader, but it is disencouraged as it also "disables a bunch of rules in spirv-val".

Example & Steps To Reproduce

  1. git clone https://github.com/Firestar99/rust-gpu-vulkano-example.git
  2. In example/build.rs change TARGET from spirv-unknown-spv1.3 to spirv-unknown-vulkan1.2 (or any other vulkan version)
  3. cargo run to see it fail when changes of 2. are applied

System Info

  • Rust: nightly-2023-05-27
  • OS: Ubuntu 23.04
  • GPU: RADV REMBRANDT
  • SPIR-V: SPIRV-Tools v2023.3 unknown hash, 2023-05-25T20:33:54
@Firestar99 Firestar99 added the t: bug Something isn't working label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@Firestar99 and others