Skip to content

How do Compat extension structs work on output? #547

Closed

Description

@kainino0x

For Compat extension structs we have this special behavior:

Special: implementations that don't support Compatibility Mode must ignore any chained structs with @ref WGPUSType values in this block, instead of erroring. This block must only be used for Compat additions that can be ignored without affecting the semantics of a non-erroring program.

However for output structs I'm not sure how this should work. (Pretty sure there is just one case of this, the Compat extension to the WGPULimits struct - #470.)

  1. Should the struct remain unpopulated (as this would imply)?
  2. Should we never put output-able compat structs in that SType block, keep them in core and require them to be implemented?

I think 2 makes the most sense to me.

Activity

  1. eliemichel commented on Jun 11, 2025

    @eliemichel
    Collaborator

    Option 1. would mean that the Compat extension is populated if and only if the adapter is Compat, so users that want to check this output should not forget to check that the adapter is Compat? For the case of limits it feels ok because the init macro would set the limits of the Compat extension to the undefined sentinel value, so in the case of a non-Compat adapter the result is just "limit is undefined", which makes sense w/o checking that the adapter is Compat.

    That being said, if it is only 1 case, it might be better to go for Option 2. so that we don't add an extra rule just for 1 case.

  2. Kangz commented on Jun 11, 2025

    @Kangz
    Collaborator

    Could we alternatively add compat atomically to webgpu.h at some point (when it lands and sticks in the WebGPU spec) and then request that all implementations of webgpu.h support all of compat at a time? After the initial addition there should be no more additional compat additions no?

  3. Kangz commented on Jun 11, 2025

    @Kangz
    Collaborator

    Ah it would break API stability after webgpu.h v1 is stable so that's a bad idea nvm.

  4. kainino0x commented on Jun 18, 2025

    @kainino0x
    CollaboratorAuthor

    +1 to both. @cwfitzgerald, WDYT?

  5. kainino0x commented on Feb 13, 2026

    @kainino0x
    CollaboratorAuthor

    These limits are always present in the WebGPU spec because they have to be implemented for portability, even when not implementing Compat (see gpuweb/gpuweb#5295). The equivalent choice here is option 2, so barring any objection (@cwfitzgerald?) that's what I think we should do in #580.

  6. added a commit that references this issue on Feb 14, 2026
    3b7d3e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    !discussNeeds discussion (at meeting or online)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions