Skip to content

Build fails with "Invalid explicit layout decorations on type for operand '355[%_ptr_Function_bubble_buckey_balls__SurfaceData]'" #44

@ky-bean

Description

@ky-bean

OS: NixOS 25.11 x86_64
Kernel: 6.15.5
DE: KDE Plasma 6.4.2 (Wayland)

I am able to successfully run the project if I change the shader target specified in build.rs to "spirv-unknown-spv1.5", however I'm not sure if that change has implications to other (non-linux especially) systems.

Command: cargo build --features=use-installed-tools --no-default-features
Building with compiled tools results in an error in spirv-tools-sys's C++ code, using installed tools solves that issue for me.

Output:

   Compiling shadertoys-wgpu v0.0.0 (/home/ky/Repos/rust-gpu/rust-gpu-shadertoys)
error: failed to run custom build command for `shadertoys-wgpu v0.0.0 (/home/ky/Repos/rust-gpu/rust-gpu-shadertoys)`

Caused by:
  process didnt exit successfully: `/home/ky/Repos/rust-gpu/rust-gpu-shadertoys/target/debug/build/shadertoys-wgpu-ea89692386d325f8/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=RUSTGPU_CODEGEN_ARGS
  cargo:rerun-if-env-changed=RUSTGPU_RUSTFLAGS
  cargo:rerun-if-env-changed=RUSTGPU_CARGOFLAGS

  --- stderr
     Compiling compiler_builtins v0.1.160 (/home/ky/.rustup/toolchains/nightly-2025-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-
     Compiling proc-macro2 v1.0.94
     Compiling core v0.0.0 (/home/ky/.rustup/toolchains/nightly-2025-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
     Compiling unicode-ident v1.0.18
     Compiling libm v0.2.11
     Compiling autocfg v1.4.0
     Compiling spirv-std-types v0.9.0 (https://github.com/Rust-GPU/rust-gpu?rev=20052f89d932ee88aba118488fc79393c407e61c#20052f89)
     Compiling num-traits v0.2.19
     Compiling quote v1.0.40
     Compiling syn v2.0.100
     Compiling bytemuck_derive v1.9.3
     Compiling spirv-std-macros v0.9.0 (https://github.com/Rust-GPU/rust-gpu?rev=20052f89d932ee88aba118488fc79393c407e61c#20052f89)
     Compiling bitflags v1.3.2
     Compiling bytemuck v1.22.0
     Compiling glam v0.29.3
     Compiling spirv-std v0.9.0 (https://github.com/Rust-GPU/rust-gpu?rev=20052f89d932ee88aba118488fc79393c407e61c#20052f89)
     Compiling shared v0.0.0 (/home/ky/Repos/rust-gpu/rust-gpu-shadertoys/shared)
     Compiling shadertoys-shaders v0.0.0 (/home/ky/Repos/rust-gpu/rust-gpu-shadertoys/shaders)
  warning: method `zero` is never used
     --> shaders/src/raymarching_primitives.rs:366:8
      |
  365 | impl Inputs {
      | ----------- method in this implementation
  366 |     fn zero(&self) -> i32 {
      |        ^^^^
      |
      = note: `#[warn(dead_code)]` on by default

  warning: error:0:0 - [VUID-StandaloneSpirv-None-10684] Invalid explicit layout decorations on type for operand '355[%_ptr_Function_bubble_buckey_balls__SurfaceData]'
             %1187 = OpVariable %_ptr_Function_bubble_buckey_balls__SurfaceData Function
    |
    = note: spirv-opt failed, leaving as unoptimized
    = note: module `/home/ky/Repos/rust-gpu/rust-gpu-shadertoys/target/spirv-builder/spirv-unknown-vulkan1.2/release/deps/shadertoys_shaders.spv`

  error: error:0:0 - [VUID-StandaloneSpirv-None-10684] Invalid explicit layout decorations on type for operand '355[%_ptr_Function_bubble_buckey_balls__SurfaceData]'
           %1187 = OpVariable %_ptr_Function_bubble_buckey_balls__SurfaceData Function
    |
    = note: spirv-val failed
    = note: module `/home/ky/Repos/rust-gpu/rust-gpu-shadertoys/target/spirv-builder/spirv-unknown-vulkan1.2/release/deps/shadertoys_shaders.spv`

  warning: `shadertoys-shaders` (lib) generated 2 warnings
  error: could not compile `shadertoys-shaders` (lib) due to 1 previous error; 2 warnings emitted
  Error: BuildFailed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions