-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make non-spec functionality stand out better #410
Comments
This is an appropriate use case for the |
(idk the context of this in wgpu-py, but just for sanity check) |
@rajveermalviya Ah it is! Thanks for clarifying 😄 |
True, but I also want to discourage people to use this non-standard functionality (unless the use-case really needs it). What triggered me is the idea that if/when we get wgpu-py working via PyScript (#407), people will want to run examples of pygfx/fastplotlib/etc. in the browser. Any code that uses non-standard stuff will then be less portable. |
The solution applied in #408 is to provide backend-specific API as functions in the corresponding backend module. We now have This solution IMO strikes a nice balance between being simple, being obviously backend-specific, not being too annoying. |
I think that with that we can close this issue. One issue to watch out for is that certain features (i.e. extensions) are backend-specific, but when using features you are probably aware of potentially breaking portability anyway. |
In addition to implementing the WebGPU spec, we also provide additional functionality that wgpu-native offers. It would be a waste not to do this, because it provides more power for desktop use-cases. However, when we add other backends, it is possible that (some of) this functionality is not available in a certain backend, making code that uses these features less portable. And that's sad, because the point of wgpu is to have portable code.
Note that this is not the quite the same as the API differences here: https://wgpu-py.readthedocs.io/en/stable/wgpu.html#differences-from-webgpu. Most these differences don't need extra functionality other than the outlined in the spec.
The cases that I know of that can be a problem are:
GPUAdapter.request_device_tracing()
.GPU.enumerate_adapters()
.Theforce_fallback_adapter
argument inrequest_adapter()
.Some ideas to help with this problem:
In deciding about this, we should also take into account how these functionalities end up in the docs.
The text was updated successfully, but these errors were encountered: