Skip to content

Passing extensible structures to application callbacks, backward-compatibly #272

@kainino0x

Description

@kainino0x

Raised in #266: we want a backward-compatible way of passing extended data to application-defined callbacks. This comes up in two places:

  • GetCompilationInfo: the callback receives WGPUCompilationInfo which is extensible, and also contains WGPUCompilationMessage objects which are also extensible
  • RequestAdapterInfo: the callback receives WGPUAdapterInfo which is not yet extensible, but needs to be

If a webgpu.h implementation suddenly starts passing new extension structs to the application, it runs the risk of the application mishandling them.

For RequestAdapterInfo we decided that the WGPUAdapterInfo should be passed as an argument to RequestAdapterInfo so the application can set up the extension chain. Then we need a wgpuAdapterInfoFreeMembers (which replaces wgpuAdapterPropertiesFreeMembers proposed in #143 but which is becoming obsolete with #266).

Metadata

Metadata

Assignees

Labels

extensibilityAdding features without breaking API changeshas resolutionIssue is resolved, just needs to be doneneeds docsNon-trivial API contract needs to be documented. Orthogonal to open vs closed; remove when doc'd.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions