You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We define structs in wgpu.structs, and use them as follows:
In the wgpu-native backend, we use it to check incoming dicts.
We generate docs off them, that users can use as a reference how to construct their dicts.
But they are not really part of the user-facing API, and (other than flags and enums) they are not injected into the root namespace.
I propose that we make the objects in wgpu.structs callable, so user can type e.g. wgpu.BindGroupEntry( and let autocompletion kick in to show the possible arguments. The call returns a normal Python dict.
In an interactive shell you can also call such an object, get the dict repr-ed in the console, and copy-paste that into your code.
In summary it makes our API a bit more discoverable.
BTW It's probably better to generate these function's code (as opposed to creating the functions dynamically at startup) so that they can be statically discovered and used (easier) by IDE's to show signatures to the user.
The text was updated successfully, but these errors were encountered:
We define structs in
wgpu.structs
, and use them as follows:But they are not really part of the user-facing API, and (other than flags and enums) they are not injected into the root namespace.
I propose that we make the objects in
wgpu.structs
callable, so user can type e.g.wgpu.BindGroupEntry(
and let autocompletion kick in to show the possible arguments. The call returns a normal Python dict.In an interactive shell you can also call such an object, get the dict repr-ed in the console, and copy-paste that into your code.
In summary it makes our API a bit more discoverable.
BTW It's probably better to generate these function's code (as opposed to creating the functions dynamically at startup) so that they can be statically discovered and used (easier) by IDE's to show signatures to the user.
The text was updated successfully, but these errors were encountered: