mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
This contains the Metal HAL changes required to support external textures. When creating a bind group we create resource bindings for each of the 3 textures and parameters buffer that the external texture has been lowered to. When creating the pipeline layout we fill the `BindTarget` accordingly, so that the Naga MSL backend can bind each of the global variables to which the the external texture has been lowered to each of these resources. We must also ensure the size of the buffer bound to the parameters global matches the size of the MSL type, else metal validation complains. We do this by adding a padding field to the rust-side ExternalTextureParams struct, the size of which is used as the size of the buffer to allocate. Lastly we enable `Features::EXTERNAL_TEXTURE` on the Metal backend.