diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/rust/wgpu-hal/src/lib.rs | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | third_party/rust/wgpu-hal/src/lib.rs | 253 |
1 files changed, 146 insertions, 107 deletions
diff --git a/third_party/rust/wgpu-hal/src/lib.rs b/third_party/rust/wgpu-hal/src/lib.rs index f1794a4a89..79bd54e66e 100644 --- a/third_party/rust/wgpu-hal/src/lib.rs +++ b/third_party/rust/wgpu-hal/src/lib.rs @@ -191,13 +191,13 @@ impl InstanceError { } pub trait Api: Clone + fmt::Debug + Sized { - type Instance: Instance<Self>; - type Surface: Surface<Self>; - type Adapter: Adapter<Self>; - type Device: Device<Self>; + type Instance: Instance<A = Self>; + type Surface: Surface<A = Self>; + type Adapter: Adapter<A = Self>; + type Device: Device<A = Self>; - type Queue: Queue<Self>; - type CommandEncoder: CommandEncoder<Self>; + type Queue: Queue<A = Self>; + type CommandEncoder: CommandEncoder<A = Self>; type CommandBuffer: WasmNotSendSync + fmt::Debug; type Buffer: fmt::Debug + WasmNotSendSync + 'static; @@ -218,18 +218,22 @@ pub trait Api: Clone + fmt::Debug + Sized { type AccelerationStructure: fmt::Debug + WasmNotSendSync + 'static; } -pub trait Instance<A: Api>: Sized + WasmNotSendSync { +pub trait Instance: Sized + WasmNotSendSync { + type A: Api; + unsafe fn init(desc: &InstanceDescriptor) -> Result<Self, InstanceError>; unsafe fn create_surface( &self, display_handle: raw_window_handle::RawDisplayHandle, window_handle: raw_window_handle::RawWindowHandle, - ) -> Result<A::Surface, InstanceError>; - unsafe fn destroy_surface(&self, surface: A::Surface); - unsafe fn enumerate_adapters(&self) -> Vec<ExposedAdapter<A>>; + ) -> Result<<Self::A as Api>::Surface, InstanceError>; + unsafe fn destroy_surface(&self, surface: <Self::A as Api>::Surface); + unsafe fn enumerate_adapters(&self) -> Vec<ExposedAdapter<Self::A>>; } -pub trait Surface<A: Api>: WasmNotSendSync { +pub trait Surface: WasmNotSendSync { + type A: Api; + /// Configures the surface to use the given device. /// /// # Safety @@ -240,7 +244,7 @@ pub trait Surface<A: Api>: WasmNotSendSync { /// - All surfaces created using other devices must have been unconfigured before this call. unsafe fn configure( &self, - device: &A::Device, + device: &<Self::A as Api>::Device, config: &SurfaceConfiguration, ) -> Result<(), SurfaceError>; @@ -252,7 +256,7 @@ pub trait Surface<A: Api>: WasmNotSendSync { /// - All [`AcquiredSurfaceTexture`]s must have been destroyed. /// - All [`Api::TextureView`]s derived from the [`AcquiredSurfaceTexture`]s must have been destroyed. /// - The surface must have been configured on the given device. - unsafe fn unconfigure(&self, device: &A::Device); + unsafe fn unconfigure(&self, device: &<Self::A as Api>::Device); /// Returns the next texture to be presented by the swapchain for drawing /// @@ -267,16 +271,18 @@ pub trait Surface<A: Api>: WasmNotSendSync { unsafe fn acquire_texture( &self, timeout: Option<std::time::Duration>, - ) -> Result<Option<AcquiredSurfaceTexture<A>>, SurfaceError>; - unsafe fn discard_texture(&self, texture: A::SurfaceTexture); + ) -> Result<Option<AcquiredSurfaceTexture<Self::A>>, SurfaceError>; + unsafe fn discard_texture(&self, texture: <Self::A as Api>::SurfaceTexture); } -pub trait Adapter<A: Api>: WasmNotSendSync { +pub trait Adapter: WasmNotSendSync { + type A: Api; + unsafe fn open( &self, features: wgt::Features, limits: &wgt::Limits, - ) -> Result<OpenDevice<A>, DeviceError>; + ) -> Result<OpenDevice<Self::A>, DeviceError>; /// Return the set of supported capabilities for a texture format. unsafe fn texture_format_capabilities( @@ -287,7 +293,10 @@ pub trait Adapter<A: Api>: WasmNotSendSync { /// Returns the capabilities of working with a specified surface. /// /// `None` means presentation is not supported for it. - unsafe fn surface_capabilities(&self, surface: &A::Surface) -> Option<SurfaceCapabilities>; + unsafe fn surface_capabilities( + &self, + surface: &<Self::A as Api>::Surface, + ) -> Option<SurfaceCapabilities>; /// Creates a [`PresentationTimestamp`] using the adapter's WSI. /// @@ -295,97 +304,111 @@ pub trait Adapter<A: Api>: WasmNotSendSync { unsafe fn get_presentation_timestamp(&self) -> wgt::PresentationTimestamp; } -pub trait Device<A: Api>: WasmNotSendSync { +pub trait Device: WasmNotSendSync { + type A: Api; + /// Exit connection to this logical device. - unsafe fn exit(self, queue: A::Queue); + unsafe fn exit(self, queue: <Self::A as Api>::Queue); /// Creates a new buffer. /// /// The initial usage is `BufferUses::empty()`. - unsafe fn create_buffer(&self, desc: &BufferDescriptor) -> Result<A::Buffer, DeviceError>; - unsafe fn destroy_buffer(&self, buffer: A::Buffer); + unsafe fn create_buffer( + &self, + desc: &BufferDescriptor, + ) -> Result<<Self::A as Api>::Buffer, DeviceError>; + unsafe fn destroy_buffer(&self, buffer: <Self::A as Api>::Buffer); //TODO: clarify if zero-sized mapping is allowed unsafe fn map_buffer( &self, - buffer: &A::Buffer, + buffer: &<Self::A as Api>::Buffer, range: MemoryRange, ) -> Result<BufferMapping, DeviceError>; - unsafe fn unmap_buffer(&self, buffer: &A::Buffer) -> Result<(), DeviceError>; - unsafe fn flush_mapped_ranges<I>(&self, buffer: &A::Buffer, ranges: I) + unsafe fn unmap_buffer(&self, buffer: &<Self::A as Api>::Buffer) -> Result<(), DeviceError>; + unsafe fn flush_mapped_ranges<I>(&self, buffer: &<Self::A as Api>::Buffer, ranges: I) where I: Iterator<Item = MemoryRange>; - unsafe fn invalidate_mapped_ranges<I>(&self, buffer: &A::Buffer, ranges: I) + unsafe fn invalidate_mapped_ranges<I>(&self, buffer: &<Self::A as Api>::Buffer, ranges: I) where I: Iterator<Item = MemoryRange>; /// Creates a new texture. /// /// The initial usage for all subresources is `TextureUses::UNINITIALIZED`. - unsafe fn create_texture(&self, desc: &TextureDescriptor) -> Result<A::Texture, DeviceError>; - unsafe fn destroy_texture(&self, texture: A::Texture); + unsafe fn create_texture( + &self, + desc: &TextureDescriptor, + ) -> Result<<Self::A as Api>::Texture, DeviceError>; + unsafe fn destroy_texture(&self, texture: <Self::A as Api>::Texture); unsafe fn create_texture_view( &self, - texture: &A::Texture, + texture: &<Self::A as Api>::Texture, desc: &TextureViewDescriptor, - ) -> Result<A::TextureView, DeviceError>; - unsafe fn destroy_texture_view(&self, view: A::TextureView); - unsafe fn create_sampler(&self, desc: &SamplerDescriptor) -> Result<A::Sampler, DeviceError>; - unsafe fn destroy_sampler(&self, sampler: A::Sampler); + ) -> Result<<Self::A as Api>::TextureView, DeviceError>; + unsafe fn destroy_texture_view(&self, view: <Self::A as Api>::TextureView); + unsafe fn create_sampler( + &self, + desc: &SamplerDescriptor, + ) -> Result<<Self::A as Api>::Sampler, DeviceError>; + unsafe fn destroy_sampler(&self, sampler: <Self::A as Api>::Sampler); /// Create a fresh [`CommandEncoder`]. /// /// The new `CommandEncoder` is in the "closed" state. unsafe fn create_command_encoder( &self, - desc: &CommandEncoderDescriptor<A>, - ) -> Result<A::CommandEncoder, DeviceError>; - unsafe fn destroy_command_encoder(&self, pool: A::CommandEncoder); + desc: &CommandEncoderDescriptor<Self::A>, + ) -> Result<<Self::A as Api>::CommandEncoder, DeviceError>; + unsafe fn destroy_command_encoder(&self, pool: <Self::A as Api>::CommandEncoder); /// Creates a bind group layout. unsafe fn create_bind_group_layout( &self, desc: &BindGroupLayoutDescriptor, - ) -> Result<A::BindGroupLayout, DeviceError>; - unsafe fn destroy_bind_group_layout(&self, bg_layout: A::BindGroupLayout); + ) -> Result<<Self::A as Api>::BindGroupLayout, DeviceError>; + unsafe fn destroy_bind_group_layout(&self, bg_layout: <Self::A as Api>::BindGroupLayout); unsafe fn create_pipeline_layout( &self, - desc: &PipelineLayoutDescriptor<A>, - ) -> Result<A::PipelineLayout, DeviceError>; - unsafe fn destroy_pipeline_layout(&self, pipeline_layout: A::PipelineLayout); + desc: &PipelineLayoutDescriptor<Self::A>, + ) -> Result<<Self::A as Api>::PipelineLayout, DeviceError>; + unsafe fn destroy_pipeline_layout(&self, pipeline_layout: <Self::A as Api>::PipelineLayout); unsafe fn create_bind_group( &self, - desc: &BindGroupDescriptor<A>, - ) -> Result<A::BindGroup, DeviceError>; - unsafe fn destroy_bind_group(&self, group: A::BindGroup); + desc: &BindGroupDescriptor<Self::A>, + ) -> Result<<Self::A as Api>::BindGroup, DeviceError>; + unsafe fn destroy_bind_group(&self, group: <Self::A as Api>::BindGroup); unsafe fn create_shader_module( &self, desc: &ShaderModuleDescriptor, shader: ShaderInput, - ) -> Result<A::ShaderModule, ShaderError>; - unsafe fn destroy_shader_module(&self, module: A::ShaderModule); + ) -> Result<<Self::A as Api>::ShaderModule, ShaderError>; + unsafe fn destroy_shader_module(&self, module: <Self::A as Api>::ShaderModule); unsafe fn create_render_pipeline( &self, - desc: &RenderPipelineDescriptor<A>, - ) -> Result<A::RenderPipeline, PipelineError>; - unsafe fn destroy_render_pipeline(&self, pipeline: A::RenderPipeline); + desc: &RenderPipelineDescriptor<Self::A>, + ) -> Result<<Self::A as Api>::RenderPipeline, PipelineError>; + unsafe fn destroy_render_pipeline(&self, pipeline: <Self::A as Api>::RenderPipeline); unsafe fn create_compute_pipeline( &self, - desc: &ComputePipelineDescriptor<A>, - ) -> Result<A::ComputePipeline, PipelineError>; - unsafe fn destroy_compute_pipeline(&self, pipeline: A::ComputePipeline); + desc: &ComputePipelineDescriptor<Self::A>, + ) -> Result<<Self::A as Api>::ComputePipeline, PipelineError>; + unsafe fn destroy_compute_pipeline(&self, pipeline: <Self::A as Api>::ComputePipeline); unsafe fn create_query_set( &self, desc: &wgt::QuerySetDescriptor<Label>, - ) -> Result<A::QuerySet, DeviceError>; - unsafe fn destroy_query_set(&self, set: A::QuerySet); - unsafe fn create_fence(&self) -> Result<A::Fence, DeviceError>; - unsafe fn destroy_fence(&self, fence: A::Fence); - unsafe fn get_fence_value(&self, fence: &A::Fence) -> Result<FenceValue, DeviceError>; + ) -> Result<<Self::A as Api>::QuerySet, DeviceError>; + unsafe fn destroy_query_set(&self, set: <Self::A as Api>::QuerySet); + unsafe fn create_fence(&self) -> Result<<Self::A as Api>::Fence, DeviceError>; + unsafe fn destroy_fence(&self, fence: <Self::A as Api>::Fence); + unsafe fn get_fence_value( + &self, + fence: &<Self::A as Api>::Fence, + ) -> Result<FenceValue, DeviceError>; /// Calling wait with a lower value than the current fence value will immediately return. unsafe fn wait( &self, - fence: &A::Fence, + fence: &<Self::A as Api>::Fence, value: FenceValue, timeout_ms: u32, ) -> Result<bool, DeviceError>; @@ -396,22 +419,24 @@ pub trait Device<A: Api>: WasmNotSendSync { unsafe fn create_acceleration_structure( &self, desc: &AccelerationStructureDescriptor, - ) -> Result<A::AccelerationStructure, DeviceError>; + ) -> Result<<Self::A as Api>::AccelerationStructure, DeviceError>; unsafe fn get_acceleration_structure_build_sizes( &self, - desc: &GetAccelerationStructureBuildSizesDescriptor<A>, + desc: &GetAccelerationStructureBuildSizesDescriptor<Self::A>, ) -> AccelerationStructureBuildSizes; unsafe fn get_acceleration_structure_device_address( &self, - acceleration_structure: &A::AccelerationStructure, + acceleration_structure: &<Self::A as Api>::AccelerationStructure, ) -> wgt::BufferAddress; unsafe fn destroy_acceleration_structure( &self, - acceleration_structure: A::AccelerationStructure, + acceleration_structure: <Self::A as Api>::AccelerationStructure, ); } -pub trait Queue<A: Api>: WasmNotSendSync { +pub trait Queue: WasmNotSendSync { + type A: Api; + /// Submits the command buffers for execution on GPU. /// /// Valid usage: @@ -422,14 +447,14 @@ pub trait Queue<A: Api>: WasmNotSendSync { /// passed to the surface_textures argument. unsafe fn submit( &self, - command_buffers: &[&A::CommandBuffer], - surface_textures: &[&A::SurfaceTexture], - signal_fence: Option<(&mut A::Fence, FenceValue)>, + command_buffers: &[&<Self::A as Api>::CommandBuffer], + surface_textures: &[&<Self::A as Api>::SurfaceTexture], + signal_fence: Option<(&mut <Self::A as Api>::Fence, FenceValue)>, ) -> Result<(), DeviceError>; unsafe fn present( &self, - surface: &A::Surface, - texture: A::SurfaceTexture, + surface: &<Self::A as Api>::Surface, + texture: <Self::A as Api>::SurfaceTexture, ) -> Result<(), SurfaceError>; unsafe fn get_timestamp_period(&self) -> f32; } @@ -472,7 +497,9 @@ pub trait Queue<A: Api>: WasmNotSendSync { /// built it. /// /// - A `CommandEncoder` must not outlive its `Device`. -pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { +pub trait CommandEncoder: WasmNotSendSync + fmt::Debug { + type A: Api; + /// Begin encoding a new command buffer. /// /// This puts this `CommandEncoder` in the "recording" state. @@ -510,7 +537,7 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// /// [`CommandBuffer`]: Api::CommandBuffer /// [`begin_encoding`]: CommandEncoder::begin_encoding - unsafe fn end_encoding(&mut self) -> Result<A::CommandBuffer, DeviceError>; + unsafe fn end_encoding(&mut self) -> Result<<Self::A as Api>::CommandBuffer, DeviceError>; /// Reclaim all resources belonging to this `CommandEncoder`. /// @@ -525,22 +552,26 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// [`CommandBuffer`]: Api::CommandBuffer unsafe fn reset_all<I>(&mut self, command_buffers: I) where - I: Iterator<Item = A::CommandBuffer>; + I: Iterator<Item = <Self::A as Api>::CommandBuffer>; unsafe fn transition_buffers<'a, T>(&mut self, barriers: T) where - T: Iterator<Item = BufferBarrier<'a, A>>; + T: Iterator<Item = BufferBarrier<'a, Self::A>>; unsafe fn transition_textures<'a, T>(&mut self, barriers: T) where - T: Iterator<Item = TextureBarrier<'a, A>>; + T: Iterator<Item = TextureBarrier<'a, Self::A>>; // copy operations - unsafe fn clear_buffer(&mut self, buffer: &A::Buffer, range: MemoryRange); + unsafe fn clear_buffer(&mut self, buffer: &<Self::A as Api>::Buffer, range: MemoryRange); - unsafe fn copy_buffer_to_buffer<T>(&mut self, src: &A::Buffer, dst: &A::Buffer, regions: T) - where + unsafe fn copy_buffer_to_buffer<T>( + &mut self, + src: &<Self::A as Api>::Buffer, + dst: &<Self::A as Api>::Buffer, + regions: T, + ) where T: Iterator<Item = BufferCopy>; /// Copy from an external image to an internal texture. @@ -551,7 +582,7 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { unsafe fn copy_external_image_to_texture<T>( &mut self, src: &wgt::ImageCopyExternalImage, - dst: &A::Texture, + dst: &<Self::A as Api>::Texture, dst_premultiplication: bool, regions: T, ) where @@ -563,9 +594,9 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// Note: the copy extent is in physical size (rounded to the block size) unsafe fn copy_texture_to_texture<T>( &mut self, - src: &A::Texture, + src: &<Self::A as Api>::Texture, src_usage: TextureUses, - dst: &A::Texture, + dst: &<Self::A as Api>::Texture, regions: T, ) where T: Iterator<Item = TextureCopy>; @@ -574,8 +605,12 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// Works with a single array layer. /// Note: `dst` current usage has to be `TextureUses::COPY_DST`. /// Note: the copy extent is in physical size (rounded to the block size) - unsafe fn copy_buffer_to_texture<T>(&mut self, src: &A::Buffer, dst: &A::Texture, regions: T) - where + unsafe fn copy_buffer_to_texture<T>( + &mut self, + src: &<Self::A as Api>::Buffer, + dst: &<Self::A as Api>::Texture, + regions: T, + ) where T: Iterator<Item = BufferTextureCopy>; /// Copy from texture to buffer. @@ -583,9 +618,9 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// Note: the copy extent is in physical size (rounded to the block size) unsafe fn copy_texture_to_buffer<T>( &mut self, - src: &A::Texture, + src: &<Self::A as Api>::Texture, src_usage: TextureUses, - dst: &A::Buffer, + dst: &<Self::A as Api>::Buffer, regions: T, ) where T: Iterator<Item = BufferTextureCopy>; @@ -596,9 +631,9 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// of all the preceding groups to be taken from `layout`. unsafe fn set_bind_group( &mut self, - layout: &A::PipelineLayout, + layout: &<Self::A as Api>::PipelineLayout, index: u32, - group: &A::BindGroup, + group: &<Self::A as Api>::BindGroup, dynamic_offsets: &[wgt::DynamicOffset], ); @@ -612,7 +647,7 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// - The range of push constants written must be valid for the pipeline layout at draw time. unsafe fn set_push_constants( &mut self, - layout: &A::PipelineLayout, + layout: &<Self::A as Api>::PipelineLayout, stages: wgt::ShaderStages, offset_bytes: u32, data: &[u32], @@ -627,18 +662,18 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { /// # Safety: /// /// - If `set` is an occlusion query set, it must be the same one as used in the [`RenderPassDescriptor::occlusion_query_set`] parameter. - unsafe fn begin_query(&mut self, set: &A::QuerySet, index: u32); + unsafe fn begin_query(&mut self, set: &<Self::A as Api>::QuerySet, index: u32); /// # Safety: /// /// - If `set` is an occlusion query set, it must be the same one as used in the [`RenderPassDescriptor::occlusion_query_set`] parameter. - unsafe fn end_query(&mut self, set: &A::QuerySet, index: u32); - unsafe fn write_timestamp(&mut self, set: &A::QuerySet, index: u32); - unsafe fn reset_queries(&mut self, set: &A::QuerySet, range: Range<u32>); + unsafe fn end_query(&mut self, set: &<Self::A as Api>::QuerySet, index: u32); + unsafe fn write_timestamp(&mut self, set: &<Self::A as Api>::QuerySet, index: u32); + unsafe fn reset_queries(&mut self, set: &<Self::A as Api>::QuerySet, range: Range<u32>); unsafe fn copy_query_results( &mut self, - set: &A::QuerySet, + set: &<Self::A as Api>::QuerySet, range: Range<u32>, - buffer: &A::Buffer, + buffer: &<Self::A as Api>::Buffer, offset: wgt::BufferAddress, stride: wgt::BufferSize, ); @@ -646,17 +681,17 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { // render passes // Begins a render pass, clears all active bindings. - unsafe fn begin_render_pass(&mut self, desc: &RenderPassDescriptor<A>); + unsafe fn begin_render_pass(&mut self, desc: &RenderPassDescriptor<Self::A>); unsafe fn end_render_pass(&mut self); - unsafe fn set_render_pipeline(&mut self, pipeline: &A::RenderPipeline); + unsafe fn set_render_pipeline(&mut self, pipeline: &<Self::A as Api>::RenderPipeline); unsafe fn set_index_buffer<'a>( &mut self, - binding: BufferBinding<'a, A>, + binding: BufferBinding<'a, Self::A>, format: wgt::IndexFormat, ); - unsafe fn set_vertex_buffer<'a>(&mut self, index: u32, binding: BufferBinding<'a, A>); + unsafe fn set_vertex_buffer<'a>(&mut self, index: u32, binding: BufferBinding<'a, Self::A>); unsafe fn set_viewport(&mut self, rect: &Rect<f32>, depth_range: Range<f32>); unsafe fn set_scissor_rect(&mut self, rect: &Rect<u32>); unsafe fn set_stencil_reference(&mut self, value: u32); @@ -679,29 +714,29 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { ); unsafe fn draw_indirect( &mut self, - buffer: &A::Buffer, + buffer: &<Self::A as Api>::Buffer, offset: wgt::BufferAddress, draw_count: u32, ); unsafe fn draw_indexed_indirect( &mut self, - buffer: &A::Buffer, + buffer: &<Self::A as Api>::Buffer, offset: wgt::BufferAddress, draw_count: u32, ); unsafe fn draw_indirect_count( &mut self, - buffer: &A::Buffer, + buffer: &<Self::A as Api>::Buffer, offset: wgt::BufferAddress, - count_buffer: &A::Buffer, + count_buffer: &<Self::A as Api>::Buffer, count_offset: wgt::BufferAddress, max_count: u32, ); unsafe fn draw_indexed_indirect_count( &mut self, - buffer: &A::Buffer, + buffer: &<Self::A as Api>::Buffer, offset: wgt::BufferAddress, - count_buffer: &A::Buffer, + count_buffer: &<Self::A as Api>::Buffer, count_offset: wgt::BufferAddress, max_count: u32, ); @@ -709,13 +744,17 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { // compute passes // Begins a compute pass, clears all active bindings. - unsafe fn begin_compute_pass(&mut self, desc: &ComputePassDescriptor<A>); + unsafe fn begin_compute_pass(&mut self, desc: &ComputePassDescriptor<Self::A>); unsafe fn end_compute_pass(&mut self); - unsafe fn set_compute_pipeline(&mut self, pipeline: &A::ComputePipeline); + unsafe fn set_compute_pipeline(&mut self, pipeline: &<Self::A as Api>::ComputePipeline); unsafe fn dispatch(&mut self, count: [u32; 3]); - unsafe fn dispatch_indirect(&mut self, buffer: &A::Buffer, offset: wgt::BufferAddress); + unsafe fn dispatch_indirect( + &mut self, + buffer: &<Self::A as Api>::Buffer, + offset: wgt::BufferAddress, + ); /// To get the required sizes for the buffer allocations use `get_acceleration_structure_build_sizes` per descriptor /// All buffers must be synchronized externally @@ -729,8 +768,8 @@ pub trait CommandEncoder<A: Api>: WasmNotSendSync + fmt::Debug { descriptor_count: u32, descriptors: T, ) where - A: 'a, - T: IntoIterator<Item = BuildAccelerationStructureDescriptor<'a, A>>; + Self::A: 'a, + T: IntoIterator<Item = BuildAccelerationStructureDescriptor<'a, Self::A>>; unsafe fn place_acceleration_structure_barrier( &mut self, |