Skip to content

Should pointers be 64-bit? #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jwollen opened this issue Apr 19, 2025 · 1 comment
Open

Should pointers be 64-bit? #238

jwollen opened this issue Apr 19, 2025 · 1 comment

Comments

@jwollen
Copy link
Contributor

jwollen commented Apr 19, 2025

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.

@LegNeato
Copy link
Collaborator

Another potential is you could do something like scoped threads, where the scope has 64bit pointer access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants