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

ABI version number in GPUInstanceDescriptor #285

Open
kainino0x opened this issue Apr 4, 2024 · 2 comments
Open

ABI version number in GPUInstanceDescriptor #285

kainino0x opened this issue Apr 4, 2024 · 2 comments
Labels
extensibility Adding features without breaking API changes non-breaking Does not require a breaking change (that would block V1.0)

Comments

@kainino0x
Copy link
Collaborator

@Kangz suggests that we could allow applications to opt into breaking changes to the ABI after 1.0, by accepting a version number in GPUInstanceDescriptor that tells us the major version of webgpu.h being used. This would for example:

  • if the application passes version 1, implementation accepts the original struct definition, which can take a chained struct for some core thing that got added after 1.0
  • if the application passes version 2, implementation accept a new struct definition that folds the chained struct in

This would be pretty lightweight to reserve for future use so I think we should just add it.

@kainino0x kainino0x added !discuss Needs discussion (at meeting or online) extensibility Adding features without breaking API changes labels Apr 4, 2024
@austinEng
Copy link
Collaborator

This would be nice for #284 if for example, it becomes core. Then we wouldn't need the chained struct for something that eventually will always available.

@kainino0x
Copy link
Collaborator Author

Apr 11 meeting:

  • Could hide it inside the header, like have wgpuCreateInstance be inline and call an internal interface with an ABI version
  • KN: Don’t necessarily have to actually do this
  • AE: Would very much like to
  • KN: What about function argument lists, structs-by-value?
    • structs by value include: FreeMembers, callback structs
  • RM: if we take version in instance descriptor, can’t change instance descriptor
    • could take it as a separate parameter outside the instance descriptor
  • Why do GL/Vk use function pointers? Remove an indirection through the loader
  • Could just deal with this in GetProcAddress, e.g. by exposing v2 symbols
  • Can add GetProcAddress2 or CreateInstance2 after 1.0 if we want
    • Implement this before trying to standardize it

@kainino0x kainino0x added non-breaking Does not require a breaking change (that would block V1.0) and removed !discuss Needs discussion (at meeting or online) labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensibility Adding features without breaking API changes non-breaking Does not require a breaking change (that would block V1.0)
Projects
None yet
Development

No branches or pull requests

2 participants