Skip to content
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

Bolt some type safety onto the wgpu Buffer API #690

Open
dfellis opened this issue Apr 9, 2024 · 0 comments
Open

Bolt some type safety onto the wgpu Buffer API #690

dfellis opened this issue Apr 9, 2024 · 0 comments
Milestone

Comments

@dfellis
Copy link
Member

dfellis commented Apr 9, 2024

The Rust wgpu API will usually simply panic! on things like invalid shader code, buffers that are too big, using shader features you didn't acquire when initializing wgpu, etc, instead of having all of these fallible APIs return a Result you need to check or unwrap.

I was honestly really surprised by this decision, and I definitely don't want this to be the experience in Alan. I feel like I'm going to end up playing whack-a-mole with issues on this, but at least for the wgpu::Buffer type, I think I can write some logic to wrap some safety onto it pretty cheaply, and make my createBuffer function return a Result<Buffer> instead of just a Buffer.

@dfellis dfellis added this to the v0.2 release milestone Jun 11, 2024
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

1 participant