mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-01-10 06:58:12 -05:00
Adds a new feature flag, `EXTERNAL_TEXTURE`, indicating device support for our implementation of WebGPU's `GPUExternalTexture` [1] which will land in upcoming patches. Conceptually this would make more sense as a downlevel flag, as it is a core part of the WebGPU spec which we do not yet support. We do not want, however, to cause applications to reject adapters because we have not finished implementing this, so for now we are making it an opt-in feature. As an initial step towards supporting this feature, this patch adds a new `BindingType` corresponding to WebGPU's `GPUExternalTextureBindingLayout` [2]. This binding type dictates that when creating a bind group the corresponding entry must be either an external texture or a texture view with certain additional requirements [3]. As of yet wgpu has no concept of an external texture (that will follow in later patches) but for now this patch ensures that texture views corresponding to an external texture binding type are validated correctly. Note that as the feature flag is not yet supported on any real backends, bind group layout creation will fail before getting the chance to attempt to create a bind group. But in the added tests using the noop backend we can see this validation taking place. [1] https://www.w3.org/TR/webgpu/#gpuexternaltexture [1] https://www.w3.org/TR/webgpu/#dictdef-gpuexternaltexturebindinglayout [2] https://gpuweb.github.io/gpuweb/#bind-group-creation