-
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
We cannot interoperate with data structures based on OpenGL/OpenCL, but we can make sure that multiple libraries that use wgpu-py can interoperate. With that I mainly mean that buffers and textures created by one tool can be consumed by another. E.g. write a shadertoy, and use the resulting texture in Pygfx or Fastplotlib. Now that we're looking into compute more (see pygfx/pygfx#1063) this becomes more relevant; being able to use the GPU to do compute, and use resulting buffers/textures to render stuff. Or render stuff and run compute on the result.
To make this work we basically need two things:
- Libs need to make use of the same device object. So we need a central place where the device object is obtained, and where libs can express the need for features and limits. We already have the notion of "default device" in
wgpu.utils
. We could expand that. - Libs need to be able to obtain the "native" (i.e. wgpu-py) object from the library-specific class. E.g. get a
GPUBuffer
from apygfx.Buffer
. We could implement something similar to the Python array protocol. This comes down to defining a spec at wgpu-py, and implementing it in Pygfx and others.
kingbedjed
Metadata
Metadata
Assignees
Labels
No labels