Rust-GPU / Rust-GPU/rust-gpu

[Migrated] Drop the constraint "only plain slices are supported as unsized types"

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/878
Old labels: t: enhancement,s: qptr may fix
Originally creatd by molikto on 2022-06-04T07:56:52Z


basically is it possible to have


#[repr(transparent)]
pub struct Test([u32]);

#[spirv(compute(threads(8, 8)))]
pub fn entry(
    #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] data: &Test,
) {
}

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

Start from the compiler validation that rejects unsized types unless they are plain slices; the issue provides no file or test path. Use the shown #[repr(transparent)] Test([u32]) storage-buffer entry point as the acceptance case, and consider the work done when this wrapper is accepted without that constraint.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.