Rust-GPU / Rust-GPU/rust-gpu

Should pointers be 64-bit?

Open
#238 2 comments 1 reaction 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

With the current 32-bit pointer width, raw physical pointers are unconvenient at best and open up a bunch of pitfalls at worst.

Technically, pointers should be 64-bit, at least when any physical addressing model is enabled.
This is problematic because of the preferred integer width of 32-bit in shaders, while Rust assumes usize in most APIs.

Is there any way we could switch to a 64-bit target without compromising performance?
For example

  • Add optimization passes to convert usize -> u32 for logical ops
  • Add a custom SPIR-V type for usize that somehow gets inferred late
  • Customize core to add u32 indexing

On the other hand, physical pointers in shaders are somewhat niche, especially with more progress towards better bindless extension.

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 by reviewing the linked PR #237 and the issue's discussion of 32-bit pointers, physical addressing, shader integer widths, and Rust's usize APIs. Determine whether a 64-bit target can be supported without compromising logical-operation performance, and document a viable direction or the reasons it is not practical.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.