Skip to content

Add textureBindingViewDimension and compat limits#580

Open
beaufortfrancois wants to merge 2 commits intowebgpu-native:mainfrom
beaufortfrancois:compat
Open

Add textureBindingViewDimension and compat limits#580
beaufortfrancois wants to merge 2 commits intowebgpu-native:mainfrom
beaufortfrancois:compat

Conversation

@beaufortfrancois
Copy link
Contributor

@beaufortfrancois beaufortfrancois commented Feb 13, 2026

Fixes #470

@beaufortfrancois
Copy link
Contributor Author

@kainino0x Please review

@beaufortfrancois beaufortfrancois changed the title Add GPUTextureDescriptor textureBindingViewDimension Add textureBindingViewDimension and compat limits Feb 13, 2026
webgpu.yml Outdated
TODO
type: bool
default: false
- name: texture_binding_view_dimension_descriptor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't remember the naming convention 100% but we might not need "descrpitor" here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, removing "descriptor" would be most consistent with other names. It would require a little work to rename in Dawn but shouldn't be too much.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually... extensions also are supposed to have prefixes. Compat has a reserved enum block, but doesn't have a name prefix defined yet:
https://github.com/webgpu-native/webgpu-headers/blob/main/doc/articles/Extensions.md#registry-of-prefixes-and-enum-blocks

We need to pick one, I guess CompatibilityMode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe since compatibility mode is special (and now that we know there's only one struct) we should just do without a prefix.

webgpu.yml Outdated
TODO
type: bool
default: false
- name: texture_binding_view_dimension_descriptor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, removing "descriptor" would be most consistent with other names. It would require a little work to rename in Dawn but shouldn't be too much.

#define WGPU_COMPATIBILITY_MODE_LIMITS_INIT _wgpu_MAKE_INIT_STRUCT(WGPUCompatibilityModeLimits, { \
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
/*.next=*/NULL _wgpu_COMMA \
/*.sType=*/WGPUSType_CompatibilityModeLimits _wgpu_COMMA \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add this SType to the yml. However, in #547, we never resolved if this would go in the compat block or the core block. (I was reminded about this while searching for open bugs).

Considering the way they work in the WebGPU spec, it seems it should be in the core block (i.e. option 2), so please do that for this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And note in the documentation why it's in the core block and not in the compat block.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Officially will be resolved by #582, so this is blocked on that.

#define WGPU_TEXTURE_BINDING_VIEW_DIMENSION_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureBindingViewDimensionDescriptor, { \
/*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
/*.next=*/NULL _wgpu_COMMA \
/*.sType=*/WGPUSType_TextureBindingViewDimensionDescriptor _wgpu_COMMA \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add this SType to the yml in the Compat block.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh also, add both new INIT macros to tests/compile/main.inl, that would catch this error.

(ugh, we really should autogenerate that, I had completely forgotten about it)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm I just remembered, I don't think the yml has a way to add things to the compat block, because the enum_prefix is global. We'll have to do something about that...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started a fix in #583, this is blocked on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new limits added for Compatibility Mode

3 participants