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

Add new limits added for Compatibility Mode #470

Open
kainino0x opened this issue Dec 14, 2024 · 3 comments
Open

Add new limits added for Compatibility Mode #470

kainino0x opened this issue Dec 14, 2024 · 3 comments
Labels
blocked on w3c Blocked on W3C gpuweb working group non-breaking Does not require a breaking change (that would block V1.0)

Comments

@kainino0x
Copy link
Collaborator

I don't expect these will be removed when we drop compatibility mode, so they should be in core (not a Compat extension struct). Currently:

  • maxStorageTexturesInFragmentStage
  • maxStorageBuffersInFragmentStage
  • maxStorageTexturesInVertexStage
  • maxStorageBuffersInVertexStage
@kainino0x kainino0x added blocked on w3c Blocked on W3C gpuweb working group try-for-v1 Nice to have for if the upstream spec is ready by the time we're finalizing webgpu.h v1 labels Dec 14, 2024
@kainino0x
Copy link
Collaborator Author

kainino0x commented Dec 19, 2024

Dec 19 meeting:

@kainino0x
Copy link
Collaborator Author

kainino0x commented Dec 19, 2024

I went to implement this and then I made this note:

Note these limits will be part of the core JS spec, because they can't be safely removed from JS (even when compat doesn't exist and they won't do anything).

The reason for this is that if we remove them from GPUSupportedLimits then applications accessing GPUSupportedLimits.maxStorageBuffersInVertexStage will get undefined.

In C, it would be somewhat safer to remove them, but not entirely. The equivalent of adapter.limits is wgpuAdapterGetLimits which takes WGPULimits as an out-struct. If we chained WGPULimits -> WGPUCompatibilityModeLimits which has an SType in the Compat block (0x0002), then non-compat-supporting webgpu.h implementations would skip over1 the extension struct and leave it uninitialized, instead of initializing it to the correct values, which could impact application behavior.
/note

HOWEVER! An application that doesn't target Compat also won't care about these limits. I was thinking it was good to get these into the main struct just to avoid more extensions. But this is kinda similar to MaxDrawCount, where it's core, but just something most people won't care about, so I think these should be in a block-0x0000 extension instead. Which makes them non-blocking for 1.0.

Footnotes

  1. this is the proposed behavior for block 0x0002 to make compat removable from webgpu.h implementations. See Allocation of implementation-specific enum values #214

@kainino0x
Copy link
Collaborator Author

@lokokung checked and thinks my logic is correct so I'm going to go ahead and close the PR and move this issue to non-breaking.

@kainino0x kainino0x added non-breaking Does not require a breaking change (that would block V1.0) and removed try-for-v1 Nice to have for if the upstream spec is ready by the time we're finalizing webgpu.h v1 labels Dec 20, 2024
@kainino0x kainino0x changed the title [try for V1] add new limits added for Compatibility Mode Add new limits added for Compatibility Mode Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked on w3c Blocked on W3C gpuweb working group non-breaking Does not require a breaking change (that would block V1.0)
Projects
None yet
Development

No branches or pull requests

1 participant