Rust-GPU / Rust-GPU/rust-gpu

Slices do not work when not coming from a buffer

Open
#164 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
3.4k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

A minimal non compiling example

#[spirv(compute(threads(256)))]
pub fn main_cs(
    #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] inoutbuf: &mut [u8],
) {
    let answer: i32 = 42;
    inoutbuf[0..4].copy_from_slice(&answer.to_le_bytes());
}

Originally posted by @izissise in https://github.com/Rust-GPU/rust-gpu/discussions/162#discussioncomment-11416575

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named. Start by reproducing the supplied non-compiling shader example and trace how a storage-buffer &mut [u8] slice is handled; done means the example compiles successfully without regressing existing slice or buffer behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.