Skip to content
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

Refactor backends #408

Merged
merged 26 commits into from
Nov 14, 2023
Merged

Refactor backends #408

merged 26 commits into from
Nov 14, 2023

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented Nov 8, 2023

In this PR:

  • Introduce an auto backend, that we can later use to select the most appropriate backend.
  • No more need to explicitly import the backend, because request_adapter() loads it automatically.
  • Rename the rs backend to wgpu_native (closes Renaming rs backend to native #393).
  • When a backend is loaded, it only replaces the wgpu.gpu object.
  • The request_adapter() function is now a method of wgpu.gpu.
  • Backend-specific logic is now only available from the backend's subpackage, as a functional API (enumerate_adapters(), request_device_tracing()).

Todo:

  • Fix up codegen.
  • Check download script.
  • Move request_device_tracing()
  • Update docs on needing to import the backend.
  • Same for readme, examples, docstrings maybe.
  • Merge Implement enumerate_adapters for rs-backend #412 in here.
  • Make canvas arg in request_adapter() optional? -> No, this arg has been removed already in next webgpu spec.
  • Check / review the pyinstaller hook (also wrt glfw).
  • Deprecate wgpu.request_adapter() in favor of wgpu.gpu.request_adapter()?
  • Update release notes.

@almarklein
Copy link
Member Author

@Korijn what dou you think about this? Just import wgpu and get going.

@almarklein almarklein mentioned this pull request Nov 9, 2023
30 tasks
@almarklein almarklein marked this pull request as ready for review November 14, 2023 13:50
@almarklein
Copy link
Member Author

@Korijn when you review, can you have a look at the current pyinstaller hook?

Copy link
Collaborator

@Korijn Korijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hook looks good to me (and so does everything else!). This was a big one! 🐋

@almarklein almarklein merged commit 7342598 into main Nov 14, 2023
@almarklein almarklein deleted the backends branch November 14, 2023 15:43
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.

Renaming rs backend to native
2 participants