Skip to content

Image store parameters are invalid - Not a global variable #522

Description

@pyranota

Expected Behaviour

Naga validation to succeed, shader to be executed by bevy

Example & Steps To Reproduce

  1. Set up simple shader using texture store:
#[inline(never)]
#[spirv(compute(threads(8, 8, 1)))]
pub fn main(
    #[spirv(global_invocation_id)] id: UVec3,
    #[spirv(descriptor_set = 0, binding = 1)] image2d: &Image!(
        2D,
        format = rgba32f,
        sampled = false
    ),
) {
    unsafe {
        image2d.write(ivec2(1, 1), vec4(3., 2., 1., 0.));
    }
}
  1. Compile
  2. naga /../shader/path.spv (or use it in bevy_render)

I'm using rust-gpu main branch, spirv-unknown-vulkan1.4 as a target in build.rs, but the error is the same for any target as far as I can tell.

Not sure if bevy reproduction set up is needed, as it fails with same error naga validation does. Something makes me think it is related to incorrect spv gen

System Info

  • Rust: rustc 1.90.0-nightly (35f603652 2025-06-29)
  • OS: NixOS
  • GPU: AMD Radeon 890M
  • SPIR-V: SPIRV-Tools v2025.5 unknown hash

Backtrace

[2026-02-03T15:08:12Z INFO  naga::front::spv] Generated by 983040 version 10600
[2026-02-03T15:08:12Z INFO  naga::front::spv] Patching...
Function [0] '' is invalid:
	Image store parameters are invalid
	Not a global variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions