Skip to content

[BUG] Broken examples? #253

@alphastrata

Description

@alphastrata

Expected Behaviour

Expect the examples to work per the instrcutions in the docs + the clap help i.e

Usage: example-runner-wgpu.exe [OPTIONS]

Options:
  -s, --shader <SHADER>       [default: Sky]
      --force-spirv-passthru
  -h, --help                  Print help

Example & Steps To Reproduce

Here's a table summarizing which examples work and which don't:

Command/Example Works?
cargo run --bin example-runner-wgpu Yes
cargo run --bin example-runner-wgpu -- -s Sky Yes
cargo run --bin example-runner-wgpu -- -s simplest-shader No
cargo run --bin example-runner-wgpu -- -s mouse-shader No
cargo run --bin example-runner-wgpu -- -s compute-shader No
cd ./examples/shaders/compute-shader && cargo run Yes

If you throw a dbg! print on the crate_name defined here:

// ./examples/runners/wgpu/src/lib.rs:140

        let crate_name = match options.shader {
            RustGPUShader::Simplest => "simplest-shader",
            RustGPUShader::Sky => "sky-shader",
            RustGPUShader::Compute => "compute-shader",
            RustGPUShader::Mouse => "mouse-shader",
        };

The EnumString is working fine as in, clap is parsing it correctly.
I do not have time right now to investigate why -- perhaps the compilation logic in each of the individual shader crates' is wrong?

System Info

  • Rust: rustc 1.84.0-nightly (b19329a37 2024-11-21) (Why do you ask for this if there's a version specified in the rust-toolchain.toml ?
  • OS: Windows 11 (using rust-lld.exe see Fix windows builds #252)
  • GPU: NVIDIA RTX TITAN (20-series)
  • SPIR-V: SPIRV-Tools v2023.3 v2022.4-198-ge7c6084f
  • SysInfo Generic: (fastfetch, like neofetch for windows)
/////////////////  /////////////////    jer@winbox
/////////////////  /////////////////    ----------
/////////////////  /////////////////    OS: Windows 11 Pro x86_64
/////////////////  /////////////////    Host: X570 AORUS ELITE WIFI (-CF)
/////////////////  /////////////////    Kernel: WIN32_NT 10.0.22631.5189 (23H2)
/////////////////  /////////////////    Uptime: 3 hours, 29 mins
/////////////////  /////////////////    Packages: 5 (scoop), 32 (choco)
/////////////////  /////////////////    Shell: PowerShell 7.5.1
                                        Display (DELA17F): 3840x1600 @ 144 Hz in 38" [External] *
/////////////////  /////////////////    Display (BenQ PD2700U): 2560x1440 @ 60 Hz in 27" [External]
/////////////////  /////////////////    DE: Fluent
/////////////////  /////////////////    WM: Desktop Window Manager 10.0.22621.5124
/////////////////  /////////////////    WM Theme: Custom - #1B3D5A (System: Dark, Apps: Dark)
/////////////////  /////////////////    Icons: Recycle Bin
/////////////////  /////////////////    Font: Segoe UI (12pt) [Caption / Menu / Message / Status]
/////////////////  /////////////////    Cursor: Windows Default (32px)
/////////////////  /////////////////    Terminal: Visual Studio Code 1.100.2
                                        CPU: AMD Ryzen 9 5950X (32) @ 5.05 GHz
                                        GPU 1: NVIDIA Parsec Virtual Display Adapter (23.69 GiB) [Discrete]
                                        GPU 2: NVIDIA TITAN RTX (23.69 GiB) [Discrete]
                                        Memory: 16.17 GiB / 31.94 GiB (51%)

Backtrace

Backtrace

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.29s
     Running `D:\rust-gpu\target\debug\example-runner-wgpu.exe --shader compute-shader`
error: invalid value 'compute-shader' for '--shader <SHADER>': Matching variant not found

Substitute the computer-shader string for any value of:

  compute-shader
  mouse-shader
  reduce
  shared
  simplest-shader
  sky-shader

for the same errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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