Skip to content

Conversation

@Kangz
Copy link
Collaborator

@Kangz Kangz commented Nov 21, 2025

PTAL! It doesn't add creation of the external texture as that's still super implementation specific, but this will unblock folks that want to use ExternalTexture in WASM (they can import a C object from a precreated JS GPUExternalTexture).

The webgpu.h diff is slightly messy because the new chained struct force a small reordering. The additions themselves should be pretty trivial and they add a chained struct for the equivalent Rust enum option in wgpu.

I chose ExternalTextureBindingLayout to match the Buffer/Sampler/...BindingLayout convention that's already used for BindGroupLayoutEntry members. ExternalTextureBindingEntry is just following that. But I'm not to attached to the exact names.

@kainino0x
Copy link
Collaborator

issue #188 (and #232)

doc: |
TODO
- name: external_texture_binding_layout
doc: Chained in @ref WGPUBindGroupLayoutEntry to specify that the corresponding entries in an @ref WGPUBindGroup will contain an @ref WGPUExternalTexture.
Copy link
Collaborator

Choose a reason for hiding this comment

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

note, just the existence of this extension in the chain has an effect - it has no fields. Which means for example if it got flattened into the parent struct (in a v2 api) it would have to be special cased. Generally I've tried to avoid this in the past, but I can't remember offhand for sure if this would be the first one or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah if we flatten it in the future, I'd expect it to become a boolean. It's a bit of a special case but seems fine. Or we can add a boolean that defaults to false and update Dawn to have that boolean as well. WDYT?

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.

2 participants