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 code generation for public API #135

Merged
merged 15 commits into from
Mar 29, 2021
Merged

Refactor code generation for public API #135

merged 15 commits into from
Mar 29, 2021

Conversation

almarklein
Copy link
Collaborator

@almarklein almarklein commented Mar 24, 2021

This is the first step in the codegen refactoring in #135. It changes how the API is created. The public API base.py is fully defined from the WebGPU spec (IDL), not from the C header. The backend implementations rs.py is defined from base.py. Any deviations from the "reference" API must be marked with decorators, making them explicit (and document-able).

I'll focus on handling of the C-header in later PR(s).

Comment on lines +61 to +67
.. autodata:: wgpu.base.apidiff
:annotation: Differences of base API:


.. autodata:: wgpu.backends.rs.apidiff
:annotation: Differences of rs backend:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm really happy about this part. The codegen enforces exactly the WebGPU API, except where methods are decorated. And all decorations are collected and end up here in the docs!

@almarklein almarklein changed the title Refactor code generation Refactor code generation for public API Mar 29, 2021
@Korijn Korijn merged commit 309a14e into main Mar 29, 2021
@Korijn Korijn deleted the codegen branch March 29, 2021 16:50
@Korijn
Copy link
Collaborator

Korijn commented Mar 29, 2021

Looks great! I don't have time to go through it with a fine comb, sorry. I trust we will identify any issues soon enough anyway :)

@almarklein
Copy link
Collaborator Author

Yeah, these changes are somehow hard to review. We could go over the code in a meeting once it has progressed further.

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.

None yet

2 participants