gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.

Home Page:https://wgpu.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarify Error Handling

cwfitzgerald opened this issue · comments

Stemmed from #3764

It is quite easy for new users to get baffled by the non-rustic error handling in wgpu right now. We should talk about this more in the documentation so that people can find their way to the appropriate error handling mechanism on their own.

Error handling is handled through three functions:

Something that should be clarified in the docs: what if two threads push multiple error scopes at the same time? Are scopes local to the current thread, or will errors be sent to the thread which opened a scope last, or something else?

On the web, this is less of an issue since everything is single-threaded, but what happens on native?

This actually wasn't really previously defined - webgpu.h we decided they're going to be thread local. We need to redefine the api in wgpu to use a thread local.