Skip to content

Conversation

@almarklein
Copy link
Member

Background

The canvas argument in request_adapter() is not part of the WebGPU spec. It is an optional argument to wgpuInstanceRequestAdapter(), so it seemed like a good idea to make it possible to pass this argument. I initially made it a required argument, but in practice it is often set to None, because we often want to create a (global) device before we have a canvas.

Changes

This PR makes the argument optional, and puts it to the end of the arg to move it a bit out of sight, making the API feel more like WebGPU.

I want to get this into the 0.12.0 release, because our users will have to adjust their request_adapter() calls already.

@almarklein almarklein requested a review from Korijn as a code owner November 15, 2023 10:02
@almarklein almarklein merged commit a88bd70 into main Nov 15, 2023
@almarklein almarklein deleted the request_adapter branch November 15, 2023 10:30
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

Successfully merging this pull request may close these issues.

3 participants