Skip to content

Support async use of wgpu? #615

@almarklein

Description

@almarklein

Relates to pygfx/wgpu-py#391

Using the async versions of the wgpu methods would possibly result in better performance, but also make pyscript support easier/possible (see pygfx/wgpu-py#407).

I think we already do all our wgpu calls from the animation function callback. So if we make that function async, and renderer.render() and probably flush(), that maybe it. Would need to look into this to be sure though.

For scripts that don't run an eventloop, we can offer a simple run utility (in wgpu or pygfx) that briefly runs an asyncio eventloop to make this animate-function run. Perhaps we can use a decorator to hide this stuff even more. Running the examples in our tests requires something similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions