pub struct Global {
pub(crate) surfaces: Registry<Arc<Surface>>,
pub(crate) hub: Hub,
pub instance: Instance,
}Fields§
§surfaces: Registry<Arc<Surface>>§hub: Hub§instance: InstanceImplementations§
Source§impl Global
impl Global
Sourcepub unsafe fn buffer_as_hal<A: Api>(
&self,
id: BufferId,
) -> Option<impl Deref<Target = A::Buffer>>
pub unsafe fn buffer_as_hal<A: Api>( &self, id: BufferId, ) -> Option<impl Deref<Target = A::Buffer>>
§Safety
- The raw buffer handle must not be manually destroyed
Sourcepub unsafe fn texture_as_hal<A: Api>(
&self,
id: TextureId,
) -> Option<impl Deref<Target = A::Texture>>
pub unsafe fn texture_as_hal<A: Api>( &self, id: TextureId, ) -> Option<impl Deref<Target = A::Texture>>
§Safety
- The raw texture handle must not be manually destroyed
Sourcepub unsafe fn texture_view_as_hal<A: Api>(
&self,
id: TextureViewId,
) -> Option<impl Deref<Target = A::TextureView>>
pub unsafe fn texture_view_as_hal<A: Api>( &self, id: TextureViewId, ) -> Option<impl Deref<Target = A::TextureView>>
§Safety
- The raw texture view handle must not be manually destroyed
Sourcepub unsafe fn adapter_as_hal<A: Api>(
&self,
id: AdapterId,
) -> Option<impl Deref<Target = A::Adapter>>
pub unsafe fn adapter_as_hal<A: Api>( &self, id: AdapterId, ) -> Option<impl Deref<Target = A::Adapter>>
§Safety
- The raw adapter handle must not be manually destroyed
Sourcepub unsafe fn device_as_hal<A: Api>(
&self,
id: DeviceId,
) -> Option<impl Deref<Target = A::Device>>
pub unsafe fn device_as_hal<A: Api>( &self, id: DeviceId, ) -> Option<impl Deref<Target = A::Device>>
§Safety
- The raw device handle must not be manually destroyed
Sourcepub unsafe fn device_fence_as_hal<A: Api>(
&self,
id: DeviceId,
) -> Option<impl Deref<Target = A::Fence>>
pub unsafe fn device_fence_as_hal<A: Api>( &self, id: DeviceId, ) -> Option<impl Deref<Target = A::Fence>>
§Safety
- The raw fence handle must not be manually destroyed
Sourcepub unsafe fn surface_as_hal<A: Api>(
&self,
id: SurfaceId,
) -> Option<impl Deref<Target = A::Surface>>
pub unsafe fn surface_as_hal<A: Api>( &self, id: SurfaceId, ) -> Option<impl Deref<Target = A::Surface>>
§Safety
- The raw surface handle must not be manually destroyed
Sourcepub unsafe fn command_encoder_as_hal_mut<A: Api, F: FnOnce(Option<&mut A::CommandEncoder>) -> R, R>(
&self,
id: CommandEncoderId,
hal_command_encoder_callback: F,
) -> R
pub unsafe fn command_encoder_as_hal_mut<A: Api, F: FnOnce(Option<&mut A::CommandEncoder>) -> R, R>( &self, id: CommandEncoderId, hal_command_encoder_callback: F, ) -> R
Sourcepub unsafe fn queue_as_hal<A: Api>(
&self,
id: QueueId,
) -> Option<impl Deref<Target = A::Queue>>
pub unsafe fn queue_as_hal<A: Api>( &self, id: QueueId, ) -> Option<impl Deref<Target = A::Queue>>
§Safety
- The raw queue handle must not be manually destroyed
Sourcepub unsafe fn blas_as_hal<A: Api>(
&self,
id: BlasId,
) -> Option<impl Deref<Target = A::AccelerationStructure>>
pub unsafe fn blas_as_hal<A: Api>( &self, id: BlasId, ) -> Option<impl Deref<Target = A::AccelerationStructure>>
§Safety
- The raw blas handle must not be manually destroyed
Sourcepub unsafe fn tlas_as_hal<A: Api>(
&self,
id: TlasId,
) -> Option<impl Deref<Target = A::AccelerationStructure>>
pub unsafe fn tlas_as_hal<A: Api>( &self, id: TlasId, ) -> Option<impl Deref<Target = A::AccelerationStructure>>
§Safety
- The raw tlas handle must not be manually destroyed
Source§impl Global
impl Global
pub fn render_bundle_encoder_set_bind_group( &self, bundle: &mut RenderBundleEncoder, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_bind_group_with_id( &self, bundle_encoder: RenderBundleEncoderId, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_pipeline( &self, bundle: &mut RenderBundleEncoder, pipeline_id: RenderPipelineId, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_pipeline_with_id( &self, bundle_encoder: RenderBundleEncoderId, pipeline_id: RenderPipelineId, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_vertex_buffer( &self, bundle: &mut RenderBundleEncoder, slot: u32, buffer_id: Option<BufferId>, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_vertex_buffer_with_id( &self, bundle_encoder: RenderBundleEncoderId, slot: u32, buffer_id: Option<BufferId>, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_index_buffer( &self, encoder: &mut RenderBundleEncoder, buffer: BufferId, index_format: IndexFormat, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_index_buffer_with_id( &self, bundle_encoder: RenderBundleEncoderId, buffer: BufferId, index_format: IndexFormat, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_immediates( &self, pass: &mut RenderBundleEncoder, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_set_immediates_with_id( &self, bundle_encoder: RenderBundleEncoderId, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw( &self, bundle: &mut RenderBundleEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_with_id( &self, bundle_encoder: RenderBundleEncoderId, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_indexed( &self, bundle: &mut RenderBundleEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: i32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_indexed_with_id( &self, bundle_encoder: RenderBundleEncoderId, index_count: u32, instance_count: u32, first_index: u32, base_vertex: i32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_indirect( &self, bundle: &mut RenderBundleEncoder, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_indirect_with_id( &self, bundle_encoder: RenderBundleEncoderId, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_indexed_indirect( &self, bundle: &mut RenderBundleEncoder, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_draw_indexed_indirect_with_id( &self, bundle_encoder: RenderBundleEncoderId, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_push_debug_group( &self, bundle: &mut RenderBundleEncoder, label: &str, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_push_debug_group_with_id( &self, bundle_encoder: RenderBundleEncoderId, label: &str, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_pop_debug_group( &self, bundle: &mut RenderBundleEncoder, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_pop_debug_group_with_id( &self, bundle_encoder: RenderBundleEncoderId, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_insert_debug_marker( &self, bundle: &mut RenderBundleEncoder, label: &str, ) -> Result<(), PassStateError>
pub fn render_bundle_encoder_insert_debug_marker_with_id( &self, bundle_encoder: RenderBundleEncoderId, label: &str, ) -> Result<(), PassStateError>
Source§impl Global
impl Global
pub fn command_encoder_clear_buffer( &self, command_encoder_id: CommandEncoderId, dst: BufferId, offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(), EncoderStateError>
pub fn command_encoder_clear_texture( &self, command_encoder_id: CommandEncoderId, dst: TextureId, subresource_range: &ImageSubresourceRange, ) -> Result<(), EncoderStateError>
Source§impl Global
impl Global
Sourcepub fn command_encoder_begin_compute_pass(
&self,
encoder_id: CommandEncoderId,
desc: &ComputePassDescriptor<'_>,
) -> (ComputePass, Option<CommandEncoderError>)
pub fn command_encoder_begin_compute_pass( &self, encoder_id: CommandEncoderId, desc: &ComputePassDescriptor<'_>, ) -> (ComputePass, Option<CommandEncoderError>)
Creates a compute pass.
If creation fails, an invalid pass is returned. Attempting to record commands into an invalid pass is permitted, but a validation error will ultimately be generated when the parent encoder is finished, and it is not possible to run any commands from the invalid pass.
If successful, puts the encoder into the Locked state.
pub fn command_encoder_begin_compute_pass_with_id( &self, encoder_id: CommandEncoderId, desc: &ComputePassDescriptor<'_>, id_in: Option<ComputePassEncoderId>, ) -> (ComputePassEncoderId, Option<CommandEncoderError>)
pub fn compute_pass_end( &self, pass: &mut ComputePass, ) -> Result<(), EncoderStateError>
pub fn compute_pass_end_with_id( &self, pass_id: ComputePassEncoderId, ) -> Result<(), EncoderStateError>
pub fn compute_pass_drop(&self, pass_id: ComputePassEncoderId)
Source§impl Global
impl Global
pub fn compute_pass_set_bind_group( &self, pass: &mut ComputePass, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn compute_pass_set_bind_group_with_id( &self, pass_id: ComputePassEncoderId, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn compute_pass_set_pipeline( &self, pass: &mut ComputePass, pipeline_id: ComputePipelineId, ) -> Result<(), PassStateError>
pub fn compute_pass_set_pipeline_with_id( &self, pass_id: ComputePassEncoderId, pipeline_id: ComputePipelineId, ) -> Result<(), PassStateError>
pub fn compute_pass_set_immediates( &self, pass: &mut ComputePass, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn compute_pass_set_immediates_with_id( &self, pass_id: ComputePassEncoderId, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn compute_pass_dispatch_workgroups( &self, pass: &mut ComputePass, groups_x: u32, groups_y: u32, groups_z: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_dispatch_workgroups_with_id( &self, pass_id: ComputePassEncoderId, groups_x: u32, groups_y: u32, groups_z: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_dispatch_workgroups_indirect( &self, pass: &mut ComputePass, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn compute_pass_dispatch_workgroups_indirect_with_id( &self, pass_id: ComputePassEncoderId, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn compute_pass_push_debug_group( &self, pass: &mut ComputePass, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_push_debug_group_with_id( &self, pass_id: ComputePassEncoderId, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_pop_debug_group( &self, pass: &mut ComputePass, ) -> Result<(), PassStateError>
pub fn compute_pass_pop_debug_group_with_id( &self, pass_id: ComputePassEncoderId, ) -> Result<(), PassStateError>
pub fn compute_pass_insert_debug_marker( &self, pass: &mut ComputePass, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_insert_debug_marker_with_id( &self, pass_id: ComputePassEncoderId, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_write_timestamp( &self, pass: &mut ComputePass, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_write_timestamp_with_id( &self, pass_id: ComputePassEncoderId, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_begin_pipeline_statistics_query( &self, pass: &mut ComputePass, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_begin_pipeline_statistics_query_with_id( &self, pass_id: ComputePassEncoderId, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn compute_pass_end_pipeline_statistics_query( &self, pass: &mut ComputePass, ) -> Result<(), PassStateError>
pub fn compute_pass_end_pipeline_statistics_query_with_id( &self, pass_id: ComputePassEncoderId, ) -> Result<(), PassStateError>
pub fn compute_pass_transition_resources( &self, pass: &mut ComputePass, buffer_transitions: impl Iterator<Item = BufferTransition<BufferId>>, texture_transitions: impl Iterator<Item = TextureTransition<TextureViewId>>, ) -> Result<(), PassStateError>
Source§impl Global
impl Global
pub fn command_encoder_write_timestamp( &self, command_encoder_id: CommandEncoderId, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), EncoderStateError>
pub fn command_encoder_resolve_query_set( &self, command_encoder_id: CommandEncoderId, query_set_id: QuerySetId, start_query: u32, query_count: u32, destination: BufferId, destination_offset: BufferAddress, ) -> Result<(), EncoderStateError>
Source§impl Global
impl Global
fn resolve_blas_id( &self, blas_id: BlasId, ) -> Result<Arc<Blas>, InvalidResourceError>
fn resolve_tlas_id( &self, tlas_id: TlasId, ) -> Result<Arc<Tlas>, InvalidResourceError>
pub fn command_encoder_mark_acceleration_structures_built( &self, command_encoder_id: CommandEncoderId, blas_ids: &[BlasId], tlas_ids: &[TlasId], ) -> Result<(), EncoderStateError>
pub fn command_encoder_build_acceleration_structures<'a>( &self, command_encoder_id: CommandEncoderId, blas_iter: impl Iterator<Item = BlasBuildEntry<'a>>, tlas_iter: impl Iterator<Item = TlasPackage<'a>>, ) -> Result<(), EncoderStateError>
Source§impl Global
impl Global
Sourcepub fn command_encoder_begin_render_pass(
&self,
encoder_id: CommandEncoderId,
desc: &RenderPassDescriptor<'_>,
) -> (RenderPass, Option<CommandEncoderError>)
pub fn command_encoder_begin_render_pass( &self, encoder_id: CommandEncoderId, desc: &RenderPassDescriptor<'_>, ) -> (RenderPass, Option<CommandEncoderError>)
Creates a render pass.
If creation fails, an invalid pass is returned. Attempting to record commands into an invalid pass is permitted, but a validation error will ultimately be generated when the parent encoder is finished, and it is not possible to run any commands from the invalid pass.
If successful, puts the encoder into the Locked state.
pub fn command_encoder_begin_render_pass_with_id( &self, encoder_id: CommandEncoderId, desc: &RenderPassDescriptor<'_>, id_in: Option<RenderPassEncoderId>, ) -> (RenderPassEncoderId, Option<CommandEncoderError>)
pub fn render_pass_end( &self, pass: &mut RenderPass, ) -> Result<(), EncoderStateError>
pub fn render_pass_end_with_id( &self, pass: RenderPassEncoderId, ) -> Result<(), EncoderStateError>
pub fn render_pass_drop(&self, pass: RenderPassEncoderId)
Source§impl Global
impl Global
pub fn render_pass_set_bind_group( &self, pass: &mut RenderPass, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn render_pass_set_bind_group_with_id( &self, pass: RenderPassEncoderId, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn render_pass_set_pipeline( &self, pass: &mut RenderPass, pipeline_id: RenderPipelineId, ) -> Result<(), PassStateError>
pub fn render_pass_set_pipeline_with_id( &self, pass: RenderPassEncoderId, pipeline_id: RenderPipelineId, ) -> Result<(), PassStateError>
pub fn render_pass_set_index_buffer( &self, pass: &mut RenderPass, buffer_id: BufferId, index_format: IndexFormat, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_pass_set_index_buffer_with_id( &self, pass: RenderPassEncoderId, buffer_id: BufferId, index_format: IndexFormat, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_pass_set_vertex_buffer( &self, pass: &mut RenderPass, slot: u32, buffer_id: Option<BufferId>, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_pass_set_vertex_buffer_with_id( &self, pass: RenderPassEncoderId, slot: u32, buffer_id: Option<BufferId>, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn render_pass_set_blend_constant( &self, pass: &mut RenderPass, color: Color, ) -> Result<(), PassStateError>
pub fn render_pass_set_blend_constant_with_id( &self, pass: RenderPassEncoderId, color: Color, ) -> Result<(), PassStateError>
pub fn render_pass_set_stencil_reference( &self, pass: &mut RenderPass, value: u32, ) -> Result<(), PassStateError>
pub fn render_pass_set_stencil_reference_with_id( &self, pass: RenderPassEncoderId, value: u32, ) -> Result<(), PassStateError>
pub fn render_pass_set_viewport( &self, pass: &mut RenderPass, x: f32, y: f32, w: f32, h: f32, depth_min: f32, depth_max: f32, ) -> Result<(), PassStateError>
pub fn render_pass_set_viewport_with_id( &self, pass: RenderPassEncoderId, x: f32, y: f32, w: f32, h: f32, depth_min: f32, depth_max: f32, ) -> Result<(), PassStateError>
pub fn render_pass_set_scissor_rect( &self, pass: &mut RenderPass, x: u32, y: u32, w: u32, h: u32, ) -> Result<(), PassStateError>
pub fn render_pass_set_scissor_rect_with_id( &self, pass: RenderPassEncoderId, x: u32, y: u32, w: u32, h: u32, ) -> Result<(), PassStateError>
pub fn render_pass_set_immediates( &self, pass: &mut RenderPass, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn render_pass_set_immediates_with_id( &self, pass: RenderPassEncoderId, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn render_pass_draw( &self, pass: &mut RenderPass, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_pass_draw_with_id( &self, pass: RenderPassEncoderId, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_pass_draw_indexed( &self, pass: &mut RenderPass, index_count: u32, instance_count: u32, first_index: u32, base_vertex: i32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_pass_draw_indexed_with_id( &self, pass: RenderPassEncoderId, index_count: u32, instance_count: u32, first_index: u32, base_vertex: i32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn render_pass_draw_mesh_tasks( &self, pass: &mut RenderPass, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) -> Result<(), RenderPassError>
pub fn render_pass_draw_indirect( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_pass_draw_indirect_with_id( &self, pass: RenderPassEncoderId, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_pass_draw_indexed_indirect( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_pass_draw_indexed_indirect_with_id( &self, pass: RenderPassEncoderId, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn render_pass_draw_mesh_tasks_indirect( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), RenderPassError>
pub fn render_pass_multi_draw_indirect( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, count: u32, ) -> Result<(), PassStateError>
pub fn render_pass_multi_draw_indexed_indirect( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, count: u32, ) -> Result<(), PassStateError>
pub fn render_pass_multi_draw_mesh_tasks_indirect( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, count: u32, ) -> Result<(), RenderPassError>
pub fn render_pass_multi_draw_indirect_count( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, count_buffer_id: BufferId, count_buffer_offset: BufferAddress, max_count: u32, ) -> Result<(), PassStateError>
pub fn render_pass_multi_draw_indexed_indirect_count( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, count_buffer_id: BufferId, count_buffer_offset: BufferAddress, max_count: u32, ) -> Result<(), PassStateError>
pub fn render_pass_multi_draw_mesh_tasks_indirect_count( &self, pass: &mut RenderPass, buffer_id: BufferId, offset: BufferAddress, count_buffer_id: BufferId, count_buffer_offset: BufferAddress, max_count: u32, ) -> Result<(), RenderPassError>
pub fn render_pass_push_debug_group( &self, pass: &mut RenderPass, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn render_pass_push_debug_group_with_id( &self, pass: RenderPassEncoderId, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn render_pass_pop_debug_group( &self, pass: &mut RenderPass, ) -> Result<(), PassStateError>
pub fn render_pass_pop_debug_group_with_id( &self, pass: RenderPassEncoderId, ) -> Result<(), PassStateError>
pub fn render_pass_insert_debug_marker( &self, pass: &mut RenderPass, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn render_pass_insert_debug_marker_with_id( &self, pass: RenderPassEncoderId, label: &str, color: u32, ) -> Result<(), PassStateError>
pub fn render_pass_write_timestamp( &self, pass: &mut RenderPass, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn render_pass_write_timestamp_with_id( &self, pass: RenderPassEncoderId, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn render_pass_begin_occlusion_query( &self, pass: &mut RenderPass, query_index: u32, ) -> Result<(), PassStateError>
pub fn render_pass_begin_occlusion_query_with_id( &self, pass: RenderPassEncoderId, query_index: u32, ) -> Result<(), PassStateError>
pub fn render_pass_end_occlusion_query( &self, pass: &mut RenderPass, ) -> Result<(), PassStateError>
pub fn render_pass_end_occlusion_query_with_id( &self, pass: RenderPassEncoderId, ) -> Result<(), PassStateError>
pub fn render_pass_begin_pipeline_statistics_query( &self, pass: &mut RenderPass, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn render_pass_begin_pipeline_statistics_query_with_id( &self, pass: RenderPassEncoderId, query_set_id: QuerySetId, query_index: u32, ) -> Result<(), PassStateError>
pub fn render_pass_end_pipeline_statistics_query( &self, pass: &mut RenderPass, ) -> Result<(), PassStateError>
pub fn render_pass_end_pipeline_statistics_query_with_id( &self, pass: RenderPassEncoderId, ) -> Result<(), PassStateError>
pub fn render_pass_execute_bundles( &self, pass: &mut RenderPass, render_bundle_ids: &[RenderBundleId], ) -> Result<(), PassStateError>
pub fn render_pass_execute_bundles_with_id( &self, pass: RenderPassEncoderId, render_bundle_ids: &[RenderBundleId], ) -> Result<(), PassStateError>
Source§impl Global
impl Global
pub fn command_encoder_copy_buffer_to_buffer( &self, command_encoder_id: CommandEncoderId, source: BufferId, source_offset: BufferAddress, destination: BufferId, destination_offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(), EncoderStateError>
pub fn command_encoder_copy_buffer_to_texture( &self, command_encoder_id: CommandEncoderId, source: &TexelCopyBufferInfo<BufferId>, destination: &TexelCopyTextureInfo<TextureId>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>
pub fn command_encoder_copy_texture_to_buffer( &self, command_encoder_id: CommandEncoderId, source: &TexelCopyTextureInfo<TextureId>, destination: &TexelCopyBufferInfo<BufferId>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>
pub fn command_encoder_copy_texture_to_texture( &self, command_encoder_id: CommandEncoderId, source: &TexelCopyTextureInfo<TextureId>, destination: &TexelCopyTextureInfo<TextureId>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>
Source§impl Global
impl Global
pub fn command_encoder_transition_resources( &self, command_encoder_id: CommandEncoderId, buffer_transitions: impl Iterator<Item = BufferTransition<BufferId>>, texture_transitions: impl Iterator<Item = TextureTransition<TextureId>>, ) -> Result<(), EncoderStateError>
Source§impl Global
impl Global
fn resolve_buffer_id( &self, buffer_id: Id<Buffer>, ) -> Result<Arc<Buffer>, InvalidResourceError>
Sourcepub fn command_encoder_finish(
&self,
encoder_id: CommandEncoderId,
desc: &CommandBufferDescriptor<Label<'_>>,
id_in: Option<CommandBufferId>,
) -> (CommandBufferId, Option<(String, CommandEncoderError)>)
pub fn command_encoder_finish( &self, encoder_id: CommandEncoderId, desc: &CommandBufferDescriptor<Label<'_>>, id_in: Option<CommandBufferId>, ) -> (CommandBufferId, Option<(String, CommandEncoderError)>)
Finishes a command encoder, creating a command buffer and returning errors that were deferred until now.
The returned String is the label of the command encoder, supplied so that wgpu can
include the label when printing deferred errors without having its own copy of the label.
This is a kludge and should be replaced if we think of a better solution to propagating
labels.
pub fn command_encoder_push_debug_group( &self, encoder_id: CommandEncoderId, label: &str, ) -> Result<(), EncoderStateError>
pub fn command_encoder_insert_debug_marker( &self, encoder_id: CommandEncoderId, label: &str, ) -> Result<(), EncoderStateError>
pub fn command_encoder_pop_debug_group( &self, encoder_id: CommandEncoderId, ) -> Result<(), EncoderStateError>
Source§impl Global
impl Global
pub fn adapter_is_surface_supported( &self, adapter_id: AdapterId, surface_id: SurfaceId, ) -> bool
pub fn surface_get_capabilities( &self, surface_id: SurfaceId, adapter_id: AdapterId, ) -> Result<SurfaceCapabilities, GetSurfaceSupportError>
Sourcepub fn surface_display_hdr_info(
&self,
surface_id: SurfaceId,
adapter_id: AdapterId,
) -> DisplayHdrInfo
pub fn surface_display_hdr_info( &self, surface_id: SurfaceId, adapter_id: AdapterId, ) -> DisplayHdrInfo
Returns the HDR and luminance characteristics of the display backing
surface_id on adapter_id.
Reports the raw display state, independent of the surface’s configured
color space; see wgt::DisplayHdrInfo for per-field platform coverage.
Returns wgt::DisplayHdrInfo::default (all fields None) when nothing
is known: the surface is not on adapter_id’s backend, the backend has
no display-query path, or the Metal backend is queried off the main
thread.
fn fetch_adapter_and_surface<F: FnOnce(&Adapter, &Surface) -> B, B>( &self, surface_id: SurfaceId, adapter_id: AdapterId, get_supported_callback: F, ) -> B
pub fn device_features(&self, device_id: DeviceId) -> Features
pub fn device_limits(&self, device_id: DeviceId) -> Limits
pub fn device_adapter_info(&self, device_id: DeviceId) -> AdapterInfo
pub fn device_downlevel_properties( &self, device_id: DeviceId, ) -> DownlevelCapabilities
pub fn device_create_buffer( &self, device_id: DeviceId, desc: &BufferDescriptor<'_>, id_in: Option<BufferId>, ) -> (BufferId, Option<CreateBufferError>)
Sourcepub fn create_buffer_error(
&self,
id_in: Option<BufferId>,
desc: &BufferDescriptor<'_>,
)
pub fn create_buffer_error( &self, id_in: Option<BufferId>, desc: &BufferDescriptor<'_>, )
Assign id_in an error with the given label.
Ensure that future attempts to use id_in as a buffer ID will propagate
the error, following the WebGPU “contagious invalidity” style.
Firefox uses this function to comply strictly with the WebGPU spec,
which requires GPUBufferDescriptor validation to be generated on the
Device timeline and leave the newly created GPUBuffer invalid.
Ideally, we would simply let device_create_buffer take care of all
of this, but some errors must be detected before we can even construct a
wgpu_types::BufferDescriptor to give it. For example, the WebGPU API
allows a GPUBufferDescriptor’s usage property to be any WebIDL
unsigned long value, but we can’t construct a
wgpu_types::BufferUsages value from values with unassigned bits
set. This means we must validate usage before we can call
device_create_buffer.
When that validation fails, we must arrange for the buffer id to be considered invalid. This method provides the means to do so.
Sourcepub fn create_render_bundle_error(
&self,
device_id: DeviceId,
id_in: Option<RenderBundleId>,
desc: &RenderBundleDescriptor<'_>,
)
pub fn create_render_bundle_error( &self, device_id: DeviceId, id_in: Option<RenderBundleId>, desc: &RenderBundleDescriptor<'_>, )
Assign id_in an error with the given label.
See Self::create_buffer_error for more context and explanation.
Sourcepub fn create_texture_error(
&self,
device_id: DeviceId,
id_in: Option<TextureId>,
desc: &TextureDescriptor<'_>,
) -> TextureId
pub fn create_texture_error( &self, device_id: DeviceId, id_in: Option<TextureId>, desc: &TextureDescriptor<'_>, ) -> TextureId
Assign id_in an error with the given label.
See Self::create_buffer_error for more context and explanation.
Sourcepub fn create_external_texture_error(
&self,
id_in: Option<ExternalTextureId>,
desc: &ExternalTextureDescriptor<'_>,
)
pub fn create_external_texture_error( &self, id_in: Option<ExternalTextureId>, desc: &ExternalTextureDescriptor<'_>, )
Assign id_in an error with the given label.
See Self::create_buffer_error for more context and explanation.
Sourcepub fn create_bind_group_layout_error(
&self,
device_id: DeviceId,
id_in: Option<BindGroupLayoutId>,
label: Option<Cow<'_, str>>,
)
pub fn create_bind_group_layout_error( &self, device_id: DeviceId, id_in: Option<BindGroupLayoutId>, label: Option<Cow<'_, str>>, )
Assign id_in an error with the given label.
In JavaScript environments, it is possible to call GPUDevice.createBindGroupLayout with
entries that are invalid. Because our Rust’s types for bind group layouts prevent even
calling Self::device_create_bind_group, we let standards-compliant environments
register an invalid bind group layout so this crate’s API can still be consistently used.
See Self::create_buffer_error for additional context and explanation.
pub fn buffer_destroy(&self, buffer_id: BufferId)
pub fn buffer_drop(&self, buffer_id: BufferId)
pub fn device_create_texture( &self, device_id: DeviceId, desc: &TextureDescriptor<'_>, id_in: Option<TextureId>, ) -> (TextureId, Option<CreateTextureError>)
Sourcepub unsafe fn create_texture_from_hal(
&self,
hal_texture: Box<dyn DynTexture>,
device_id: DeviceId,
desc: &TextureDescriptor<'_>,
initial_state: TextureUses,
id_in: Option<TextureId>,
) -> (TextureId, Option<CreateTextureError>)
pub unsafe fn create_texture_from_hal( &self, hal_texture: Box<dyn DynTexture>, device_id: DeviceId, desc: &TextureDescriptor<'_>, initial_state: TextureUses, id_in: Option<TextureId>, ) -> (TextureId, Option<CreateTextureError>)
§Safety
hal_texturemust be created fromdevice_idcorresponding raw handle.hal_texturemust be created respectingdeschal_texturemust be initialized- The
initial_statemust match the actual driver-side state of the wrapped resource at the moment of wrap.
Sourcepub unsafe fn create_buffer_from_hal<A: Api>(
&self,
hal_buffer: A::Buffer,
device_id: DeviceId,
desc: &BufferDescriptor<'_>,
id_in: Option<BufferId>,
) -> (BufferId, Option<CreateBufferError>)
pub unsafe fn create_buffer_from_hal<A: Api>( &self, hal_buffer: A::Buffer, device_id: DeviceId, desc: &BufferDescriptor<'_>, id_in: Option<BufferId>, ) -> (BufferId, Option<CreateBufferError>)
§Safety
hal_buffermust be created fromdevice_idcorresponding raw handle.hal_buffermust be created respectingdeschal_buffermust be initializedhal_buffermust not have zero size.
pub fn texture_destroy(&self, texture_id: TextureId)
pub fn texture_drop(&self, texture_id: TextureId)
pub fn texture_create_view( &self, texture_id: TextureId, desc: &TextureViewDescriptor<'_>, id_in: Option<TextureViewId>, ) -> (TextureViewId, Option<CreateTextureViewError>)
pub fn texture_view_drop(&self, texture_view_id: TextureViewId)
pub fn device_create_external_texture( &self, device_id: DeviceId, desc: &ExternalTextureDescriptor<'_>, planes: &[TextureViewId], id_in: Option<ExternalTextureId>, ) -> (ExternalTextureId, Option<CreateExternalTextureError>)
pub fn external_texture_destroy(&self, external_texture_id: ExternalTextureId)
pub fn external_texture_drop(&self, external_texture_id: ExternalTextureId)
pub fn device_create_sampler( &self, device_id: DeviceId, desc: &SamplerDescriptor<'_>, id_in: Option<SamplerId>, ) -> (SamplerId, Option<CreateSamplerError>)
pub fn sampler_drop(&self, sampler_id: SamplerId)
pub fn device_create_bind_group_layout( &self, device_id: DeviceId, desc: &BindGroupLayoutDescriptor<'_>, id_in: Option<BindGroupLayoutId>, ) -> (BindGroupLayoutId, Option<CreateBindGroupLayoutError>)
pub fn bind_group_layout_drop(&self, bind_group_layout_id: BindGroupLayoutId)
pub fn device_create_pipeline_layout( &self, device_id: DeviceId, desc: &PipelineLayoutDescriptor<'_>, id_in: Option<PipelineLayoutId>, ) -> (PipelineLayoutId, Option<CreatePipelineLayoutError>)
pub fn pipeline_layout_drop(&self, pipeline_layout_id: PipelineLayoutId)
pub fn device_create_bind_group( &self, device_id: DeviceId, desc: &BindGroupDescriptor<'_>, id_in: Option<BindGroupId>, ) -> (BindGroupId, Option<CreateBindGroupError>)
pub fn bind_group_drop(&self, bind_group_id: BindGroupId)
Sourcepub fn device_create_shader_module(
&self,
device_id: DeviceId,
desc: &ShaderModuleDescriptor<'_>,
source: ShaderModuleSource<'_>,
id_in: Option<ShaderModuleId>,
) -> (ShaderModuleId, Option<CreateShaderModuleError>)
pub fn device_create_shader_module( &self, device_id: DeviceId, desc: &ShaderModuleDescriptor<'_>, source: ShaderModuleSource<'_>, id_in: Option<ShaderModuleId>, ) -> (ShaderModuleId, Option<CreateShaderModuleError>)
Create a shader module with the given source.
This function may consume a lot of stack space. Compiler-enforced limits for parsing recursion exist; if shader compilation runs into them, it will return an error gracefully. However, on some build profiles and platforms, the default stack size for a thread may be exceeded before this limit is reached during parsing. Callers should ensure that there is enough stack space for this, particularly if calls to this method are exposed to user input.
Sourcepub unsafe fn device_create_shader_module_passthrough(
&self,
device_id: DeviceId,
desc: &ShaderModuleDescriptorPassthrough<'_>,
id_in: Option<ShaderModuleId>,
) -> (ShaderModuleId, Option<CreateShaderModuleError>)
pub unsafe fn device_create_shader_module_passthrough( &self, device_id: DeviceId, desc: &ShaderModuleDescriptorPassthrough<'_>, id_in: Option<ShaderModuleId>, ) -> (ShaderModuleId, Option<CreateShaderModuleError>)
§Safety
This function passes source code or binary to the backend as-is and can potentially result in a driver crash.
pub fn shader_module_drop(&self, shader_module_id: ShaderModuleId)
pub fn device_create_command_encoder( &self, device_id: DeviceId, desc: &CommandEncoderDescriptor<Label<'_>>, id_in: Option<CommandEncoderId>, ) -> (CommandEncoderId, Option<DeviceError>)
pub fn command_encoder_drop(&self, command_encoder_id: CommandEncoderId)
pub fn command_buffer_drop(&self, command_buffer_id: CommandBufferId)
pub fn device_create_render_bundle_encoder( &self, device_id: DeviceId, desc: &RenderBundleEncoderDescriptor<'_>, ) -> (Box<RenderBundleEncoder>, Option<CreateRenderBundleError>)
pub fn device_create_render_bundle_encoder_with_id( &self, device_id: DeviceId, desc: &RenderBundleEncoderDescriptor<'_>, id_in: Option<RenderBundleEncoderId>, ) -> (RenderBundleEncoderId, Option<CreateRenderBundleError>)
pub fn render_bundle_encoder_finish( &self, bundle_encoder: &mut RenderBundleEncoder, desc: &RenderBundleDescriptor<'_>, id_in: Option<RenderBundleId>, ) -> (RenderBundleId, Option<RenderBundleError>)
pub fn render_bundle_encoder_finish_with_id( &self, render_bundle_encoder_id: RenderBundleEncoderId, desc: &RenderBundleDescriptor<'_>, id_in: Option<RenderBundleId>, ) -> (RenderBundleId, Option<RenderBundleError>)
pub fn render_bundle_encoder_drop( &self, render_bundle_encoder_id: RenderBundleEncoderId, )
pub fn render_bundle_drop(&self, render_bundle_id: RenderBundleId)
pub fn device_create_query_set( &self, device_id: DeviceId, desc: &QuerySetDescriptor<'_>, id_in: Option<QuerySetId>, ) -> (QuerySetId, Option<CreateQuerySetError>)
pub fn query_set_destroy(&self, query_set_id: QuerySetId)
pub fn query_set_drop(&self, query_set_id: QuerySetId)
pub fn device_create_render_pipeline( &self, device_id: DeviceId, desc: &RenderPipelineDescriptor<'_>, id_in: Option<RenderPipelineId>, ) -> (RenderPipelineId, Option<CreateRenderPipelineError>)
pub fn device_create_mesh_pipeline( &self, device_id: DeviceId, desc: &MeshPipelineDescriptor<'_>, id_in: Option<RenderPipelineId>, ) -> (RenderPipelineId, Option<CreateRenderPipelineError>)
fn device_create_general_render_pipeline( &self, desc: GeneralRenderPipelineDescriptor<'_>, device: Arc<Device>, fid: FutureId<'_, Arc<RenderPipeline>>, ) -> (RenderPipelineId, Option<CreateRenderPipelineError>)
Sourcepub fn render_pipeline_get_bind_group_layout(
&self,
pipeline_id: RenderPipelineId,
index: u32,
id_in: Option<BindGroupLayoutId>,
) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
pub fn render_pipeline_get_bind_group_layout( &self, pipeline_id: RenderPipelineId, index: u32, id_in: Option<BindGroupLayoutId>, ) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
Get an ID of one of the bind group layouts. The ID adds a refcount,
which needs to be released by calling bind_group_layout_drop.
pub fn render_pipeline_drop(&self, render_pipeline_id: RenderPipelineId)
pub fn device_create_compute_pipeline( &self, device_id: DeviceId, desc: &ComputePipelineDescriptor<'_>, id_in: Option<ComputePipelineId>, ) -> (ComputePipelineId, Option<CreateComputePipelineError>)
Sourcepub fn compute_pipeline_get_bind_group_layout(
&self,
pipeline_id: ComputePipelineId,
index: u32,
id_in: Option<BindGroupLayoutId>,
) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
pub fn compute_pipeline_get_bind_group_layout( &self, pipeline_id: ComputePipelineId, index: u32, id_in: Option<BindGroupLayoutId>, ) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
Get an ID of one of the bind group layouts. The ID adds a refcount,
which needs to be released by calling bind_group_layout_drop.
pub fn compute_pipeline_drop(&self, compute_pipeline_id: ComputePipelineId)
Sourcepub unsafe fn device_create_pipeline_cache(
&self,
device_id: DeviceId,
desc: &PipelineCacheDescriptor<'_>,
id_in: Option<PipelineCacheId>,
) -> (PipelineCacheId, Option<CreatePipelineCacheError>)
pub unsafe fn device_create_pipeline_cache( &self, device_id: DeviceId, desc: &PipelineCacheDescriptor<'_>, id_in: Option<PipelineCacheId>, ) -> (PipelineCacheId, Option<CreatePipelineCacheError>)
§Safety
The data argument of desc must have been returned by
Self::pipeline_cache_get_data for the same adapter
pub fn pipeline_cache_drop(&self, pipeline_cache_id: PipelineCacheId)
pub fn surface_configure( &self, surface_id: SurfaceId, device_id: DeviceId, config: &SurfaceConfiguration<Vec<TextureFormat>>, ) -> Option<ConfigureSurfaceError>
Sourcepub fn device_poll(
&self,
device_id: DeviceId,
poll_type: PollType<SubmissionIndex>,
) -> Result<PollStatus, WaitIdleError>
pub fn device_poll( &self, device_id: DeviceId, poll_type: PollType<SubmissionIndex>, ) -> Result<PollStatus, WaitIdleError>
Check device_id for freeable resources and completed buffer mappings.
Return queue_empty indicating whether there are more queue submissions still in flight.
Sourcefn poll_all_devices_of_api(
&self,
force_wait: bool,
closure_list: &mut UserClosures,
) -> Result<bool, WaitIdleError>
fn poll_all_devices_of_api( &self, force_wait: bool, closure_list: &mut UserClosures, ) -> Result<bool, WaitIdleError>
Poll all devices belonging to the specified backend.
If force_wait is true, block until all buffer mappings are done.
Return all_queue_empty indicating whether there are more queue
submissions still in flight.
Sourcepub fn poll_all_devices(&self, force_wait: bool) -> Result<bool, WaitIdleError>
pub fn poll_all_devices(&self, force_wait: bool) -> Result<bool, WaitIdleError>
Poll all devices on all backends.
This is the implementation of wgpu::Instance::poll_all.
Return all_queue_empty indicating whether there are more queue
submissions still in flight.
Sourcepub unsafe fn device_start_graphics_debugger_capture(&self, device_id: DeviceId)
pub unsafe fn device_start_graphics_debugger_capture(&self, device_id: DeviceId)
§Safety
- See wgpu::Device::start_graphics_debugger_capture for details the safety.
Sourcepub unsafe fn device_stop_graphics_debugger_capture(&self, device_id: DeviceId)
pub unsafe fn device_stop_graphics_debugger_capture(&self, device_id: DeviceId)
§Safety
- See wgpu::Device::stop_graphics_debugger_capture for details the safety.
pub fn pipeline_cache_get_data(&self, id: PipelineCacheId) -> Option<Vec<u8>>
pub fn device_drop(&self, device_id: DeviceId)
Sourcepub fn device_set_device_lost_closure(
&self,
device_id: DeviceId,
device_lost_closure: DeviceLostClosure,
)
pub fn device_set_device_lost_closure( &self, device_id: DeviceId, device_lost_closure: DeviceLostClosure, )
device_lost_closure might never be called.
pub fn device_destroy(&self, device_id: DeviceId)
pub fn device_get_internal_counters( &self, device_id: DeviceId, ) -> InternalCounters
pub fn device_generate_allocator_report( &self, device_id: DeviceId, ) -> Option<AllocatorReport>
pub fn device_take_trace( &self, device_id: DeviceId, ) -> Option<Box<dyn Trace + Send + Sync + 'static>>
trace only.pub fn queue_drop(&self, queue_id: QueueId)
Sourcepub fn buffer_map_async(
&self,
buffer_id: BufferId,
offset: BufferAddress,
size: Option<BufferAddress>,
op: BufferMapOperation,
) -> Result<SubmissionIndex, BufferAccessError>
pub fn buffer_map_async( &self, buffer_id: BufferId, offset: BufferAddress, size: Option<BufferAddress>, op: BufferMapOperation, ) -> Result<SubmissionIndex, BufferAccessError>
op.callback is always called, even in case of errors.
pub fn buffer_get_mapped_range( &self, buffer_id: BufferId, offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(NonNull<u8>, u64), BufferAccessError>
pub fn buffer_unmap(&self, buffer_id: BufferId) -> BufferAccessResult
Source§impl Global
impl Global
pub fn queue_write_buffer( &self, queue_id: QueueId, buffer_id: BufferId, buffer_offset: BufferAddress, data: &[u8], ) -> Result<(), QueueWriteError>
pub fn queue_create_staging_buffer( &self, queue_id: QueueId, buffer_size: BufferSize, id_in: Option<StagingBufferId>, ) -> Result<(StagingBufferId, NonNull<u8>), QueueWriteError>
pub fn queue_write_staging_buffer( &self, queue_id: QueueId, buffer_id: BufferId, buffer_offset: BufferAddress, staging_buffer_id: StagingBufferId, ) -> Result<(), QueueWriteError>
pub fn queue_validate_write_buffer( &self, queue_id: QueueId, buffer_id: BufferId, buffer_offset: u64, buffer_size: BufferSize, ) -> Result<(), QueueWriteError>
pub fn queue_write_texture( &self, queue_id: QueueId, destination: &TexelCopyTextureInfo<TextureId>, data: &[u8], data_layout: &TexelCopyBufferLayout, size: &Extent3d, ) -> Result<(), QueueWriteError>
pub fn queue_submit( &self, queue_id: QueueId, command_buffer_ids: &[CommandBufferId], ) -> Result<SubmissionIndex, (SubmissionIndex, QueueSubmitError)>
pub fn queue_get_timestamp_period(&self, queue_id: QueueId) -> f32
pub fn queue_on_submitted_work_done( &self, queue_id: QueueId, closure: SubmittedWorkDoneClosure, ) -> SubmissionIndex
pub fn queue_compact_blas( &self, queue_id: QueueId, blas_id: BlasId, id_in: Option<BlasId>, ) -> (BlasId, Option<u64>, Option<CompactBlasError>)
Source§impl Global
impl Global
pub fn device_create_blas( &self, device_id: DeviceId, desc: &BlasDescriptor<'_>, sizes: BlasGeometrySizeDescriptors, id_in: Option<BlasId>, ) -> (BlasId, Option<u64>, Option<CreateBlasError>)
pub fn device_create_tlas( &self, device_id: DeviceId, desc: &TlasDescriptor<'_>, id_in: Option<TlasId>, ) -> (TlasId, Option<CreateTlasError>)
pub fn blas_drop(&self, blas_id: BlasId)
pub fn tlas_drop(&self, tlas_id: TlasId)
pub fn blas_prepare_compact_async( &self, blas_id: BlasId, callback: Option<BlasCompactCallback>, ) -> Result<SubmissionIndex, BlasPrepareCompactError>
pub fn ready_for_compaction( &self, blas_id: BlasId, ) -> Result<bool, InvalidResourceError>
Source§impl Global
impl Global
pub fn new( name: &str, instance_desc: InstanceDescriptor, telemetry: Option<Telemetry>, ) -> Self
Sourcepub unsafe fn from_hal_instance<A: Api>(
name: &str,
hal_instance: A::Instance,
) -> Self
pub unsafe fn from_hal_instance<A: Api>( name: &str, hal_instance: A::Instance, ) -> Self
§Safety
Refer to the creation of wgpu-hal Instance for every backend.
Sourcepub unsafe fn instance_as_hal<A: Api>(&self) -> Option<&A::Instance>
pub unsafe fn instance_as_hal<A: Api>(&self) -> Option<&A::Instance>
§Safety
- The raw instance handle returned must not be manually destroyed.
Sourcepub unsafe fn from_instance(instance: Instance) -> Self
pub unsafe fn from_instance(instance: Instance) -> Self
§Safety
- The raw handles obtained from the Instance must not be manually destroyed
pub fn generate_report(&self) -> GlobalReport
Source§impl Global
impl Global
Sourcepub fn import_adapter(
&self,
adapter: Arc<Adapter>,
id_in: Option<AdapterId>,
) -> AdapterId
pub fn import_adapter( &self, adapter: Arc<Adapter>, id_in: Option<AdapterId>, ) -> AdapterId
Import Arc<Adapter> into the global hub,
returning an AdapterId under which the adapter is stored.
Sourcepub fn resolve_adapter_id(&self, adapter_id: AdapterId) -> Arc<Adapter>
pub fn resolve_adapter_id(&self, adapter_id: AdapterId) -> Arc<Adapter>
Resolve an AdapterId to the corresponding Arc<Adapter> in the global hub.
Sourcepub fn import_device(
&self,
device: Arc<Device>,
id_in: Option<DeviceId>,
) -> DeviceId
pub fn import_device( &self, device: Arc<Device>, id_in: Option<DeviceId>, ) -> DeviceId
Import Arc<Device> into the global hub,
returning a DeviceId under which the device is stored.
Sourcepub fn resolve_device_id(&self, device_id: DeviceId) -> Arc<Device>
pub fn resolve_device_id(&self, device_id: DeviceId) -> Arc<Device>
Resolve a DeviceId to the corresponding Arc<Device> in the global hub.
Sourcepub fn import_queue(&self, queue: Arc<Queue>, id_in: Option<QueueId>) -> QueueId
pub fn import_queue(&self, queue: Arc<Queue>, id_in: Option<QueueId>) -> QueueId
Import Arc<Queue> into the global hub,
returning a QueueId under which the queue is stored.
Sourcepub fn resolve_queue_id(&self, queue_id: QueueId) -> Arc<Queue>
pub fn resolve_queue_id(&self, queue_id: QueueId) -> Arc<Queue>
Resolve a QueueId to the corresponding Arc<Queue> in the global hub.
Sourcepub fn import_pipeline_layout(
&self,
pipeline_layout: Arc<PipelineLayout>,
id_in: Option<PipelineLayoutId>,
) -> PipelineLayoutId
pub fn import_pipeline_layout( &self, pipeline_layout: Arc<PipelineLayout>, id_in: Option<PipelineLayoutId>, ) -> PipelineLayoutId
Import Arc<PipelineLayout> into the global hub,
returning a PipelineLayoutId under which the pipeline layout is stored.
Sourcepub fn resolve_pipeline_layout_id(
&self,
pipeline_layout_id: PipelineLayoutId,
) -> Arc<PipelineLayout>
pub fn resolve_pipeline_layout_id( &self, pipeline_layout_id: PipelineLayoutId, ) -> Arc<PipelineLayout>
Resolve a PipelineLayoutId to the corresponding Arc<PipelineLayout> in the global hub.
Sourcepub fn import_bind_group_layout(
&self,
bind_group_layout: Arc<BindGroupLayout>,
id_in: Option<BindGroupLayoutId>,
) -> BindGroupLayoutId
pub fn import_bind_group_layout( &self, bind_group_layout: Arc<BindGroupLayout>, id_in: Option<BindGroupLayoutId>, ) -> BindGroupLayoutId
Import Arc<BindGroupLayout> into the global hub,
returning a BindGroupLayoutId under which the bind group layout is stored.
Sourcepub fn resolve_bind_group_layout_id(
&self,
bind_group_layout_id: BindGroupLayoutId,
) -> Arc<BindGroupLayout>
pub fn resolve_bind_group_layout_id( &self, bind_group_layout_id: BindGroupLayoutId, ) -> Arc<BindGroupLayout>
Resolve a BindGroupLayoutId to the corresponding Arc<BindGroupLayout> in the global hub.
Sourcepub fn import_command_encoder(
&self,
command_encoder: Arc<CommandEncoder>,
id_in: Option<CommandEncoderId>,
) -> CommandEncoderId
pub fn import_command_encoder( &self, command_encoder: Arc<CommandEncoder>, id_in: Option<CommandEncoderId>, ) -> CommandEncoderId
Import Arc<CommandEncoder> into the global hub,
returning a CommandEncoderId under which the command encoder is stored.
Sourcepub fn resolve_command_encoder_id(
&self,
command_encoder_id: CommandEncoderId,
) -> Arc<CommandEncoder>
pub fn resolve_command_encoder_id( &self, command_encoder_id: CommandEncoderId, ) -> Arc<CommandEncoder>
Resolve a CommandEncoderId to the corresponding Arc<CommandEncoder> in the global hub.
Sourcepub fn import_command_buffer(
&self,
command_buffer: Arc<CommandBuffer>,
id_in: Option<CommandBufferId>,
) -> CommandBufferId
pub fn import_command_buffer( &self, command_buffer: Arc<CommandBuffer>, id_in: Option<CommandBufferId>, ) -> CommandBufferId
Import Arc<CommandBuffer> into the global hub,
returning a CommandBufferId under which the command buffer is stored.
Sourcepub fn resolve_command_buffer_id(
&self,
command_buffer_id: CommandBufferId,
) -> Arc<CommandBuffer>
pub fn resolve_command_buffer_id( &self, command_buffer_id: CommandBufferId, ) -> Arc<CommandBuffer>
Resolve a CommandBufferId to the corresponding Arc<CommandBuffer> in the global hub.
Sourcepub fn import_render_pipeline(
&self,
render_pipeline: Arc<RenderPipeline>,
id_in: Option<RenderPipelineId>,
) -> RenderPipelineId
pub fn import_render_pipeline( &self, render_pipeline: Arc<RenderPipeline>, id_in: Option<RenderPipelineId>, ) -> RenderPipelineId
Import Arc<RenderPipeline> into the global hub,
returning a RenderPipelineId under which the render pipeline is stored.
Sourcepub fn resolve_render_pipeline_id(
&self,
render_pipeline_id: RenderPipelineId,
) -> Arc<RenderPipeline>
pub fn resolve_render_pipeline_id( &self, render_pipeline_id: RenderPipelineId, ) -> Arc<RenderPipeline>
Resolve a RenderPipelineId to the corresponding Arc<RenderPipeline> in the global hub.
Sourcepub fn import_compute_pipeline(
&self,
compute_pipeline: Arc<ComputePipeline>,
id_in: Option<ComputePipelineId>,
) -> ComputePipelineId
pub fn import_compute_pipeline( &self, compute_pipeline: Arc<ComputePipeline>, id_in: Option<ComputePipelineId>, ) -> ComputePipelineId
Import Arc<ComputePipeline> into the global hub,
returning a ComputePipelineId under which the compute pipeline is stored.
Sourcepub fn resolve_compute_pipeline_id(
&self,
compute_pipeline_id: ComputePipelineId,
) -> Arc<ComputePipeline>
pub fn resolve_compute_pipeline_id( &self, compute_pipeline_id: ComputePipelineId, ) -> Arc<ComputePipeline>
Resolve a ComputePipelineId to the corresponding Arc<ComputePipeline> in the global hub.
Sourcepub fn import_query_set(
&self,
query_set: Arc<QuerySet>,
id_in: Option<QuerySetId>,
) -> QuerySetId
pub fn import_query_set( &self, query_set: Arc<QuerySet>, id_in: Option<QuerySetId>, ) -> QuerySetId
Import Arc<QuerySet> into the global hub,
returning a QuerySetId under which the query set is stored.
Sourcepub fn resolve_query_set_id(&self, query_set_id: QuerySetId) -> Arc<QuerySet>
pub fn resolve_query_set_id(&self, query_set_id: QuerySetId) -> Arc<QuerySet>
Resolve a QuerySetId to the corresponding Arc<QuerySet> in the global hub.
Sourcepub fn import_texture(
&self,
texture: Arc<Texture>,
id_in: Option<TextureId>,
) -> TextureId
pub fn import_texture( &self, texture: Arc<Texture>, id_in: Option<TextureId>, ) -> TextureId
Import Arc<Texture> into the global hub,
returning a TextureId under which the texture is stored.
Sourcepub fn resolve_texture_id(&self, texture_id: TextureId) -> Arc<Texture>
pub fn resolve_texture_id(&self, texture_id: TextureId) -> Arc<Texture>
Resolve a TextureId to the corresponding Arc<Texture> in the global hub.
Source§impl Global
impl Global
Sourcepub unsafe fn instance_create_surface(
&self,
display_handle: Option<RawDisplayHandle>,
window_handle: RawWindowHandle,
id_in: Option<SurfaceId>,
) -> Result<SurfaceId, CreateSurfaceError>
pub unsafe fn instance_create_surface( &self, display_handle: Option<RawDisplayHandle>, window_handle: RawWindowHandle, id_in: Option<SurfaceId>, ) -> Result<SurfaceId, CreateSurfaceError>
Creates a new surface targeting the given display/window handles.
Internally attempts to create hal surfaces for all enabled backends.
Fails only if creation for surfaces for all enabled backends fails in which case the error for each enabled backend is listed. Vice versa, if creation for any backend succeeds, success is returned. Surface creation errors are logged to the debug log in any case.
id_in:
- If
Some, the id to assign to the surface. A new one will be generated otherwise.
§Safety
display_handlemust be a valid object to create a surface upon, falls back to the instance display handle otherwise.window_handlemust remain valid as long as the returnedSurfaceIdis being used.
pub fn surface_drop(&self, id: SurfaceId)
pub fn enumerate_adapters( &self, backends: Backends, apply_limit_buckets: bool, ) -> Vec<AdapterId> ⓘ
pub fn request_adapter( &self, desc: &RequestAdapterOptions, backends: Backends, id_in: Option<AdapterId>, ) -> Result<AdapterId, RequestAdapterError>
Sourcepub unsafe fn create_adapter_from_hal(
&self,
hal_adapter: DynExposedAdapter,
input: Option<AdapterId>,
) -> AdapterId
pub unsafe fn create_adapter_from_hal( &self, hal_adapter: DynExposedAdapter, input: Option<AdapterId>, ) -> AdapterId
Create an adapter from a HAL adapter.
The HAL adapter may be obtained e.g. by calling enumerate_adapters on
the HAL directly.
If limit bucketing is desired, crate::limits::apply_limit_buckets
should be called with the HAL adapter before calling this function.
§Safety
hal_adapter must be created from this global internal instance handle.
pub fn adapter_get_info(&self, adapter_id: AdapterId) -> AdapterInfo
pub fn adapter_get_texture_format_features( &self, adapter_id: AdapterId, format: TextureFormat, ) -> TextureFormatFeatures
pub fn adapter_features(&self, adapter_id: AdapterId) -> Features
pub fn adapter_limits(&self, adapter_id: AdapterId) -> Limits
pub fn adapter_downlevel_capabilities( &self, adapter_id: AdapterId, ) -> DownlevelCapabilities
pub fn adapter_get_presentation_timestamp( &self, adapter_id: AdapterId, ) -> PresentationTimestamp
pub fn adapter_cooperative_matrix_properties( &self, adapter_id: AdapterId, ) -> Vec<CooperativeMatrixProperties>
pub fn adapter_drop(&self, adapter_id: AdapterId)
Source§impl Global
impl Global
pub fn adapter_request_device( &self, adapter_id: AdapterId, desc: &DeviceDescriptor<'_>, device_id_in: Option<DeviceId>, queue_id_in: Option<QueueId>, ) -> Result<(DeviceId, QueueId), RequestDeviceError>
Sourcepub unsafe fn create_device_from_hal(
&self,
adapter_id: AdapterId,
hal_device: DynOpenDevice,
desc: &DeviceDescriptor<'_>,
device_id_in: Option<DeviceId>,
queue_id_in: Option<QueueId>,
) -> Result<(DeviceId, QueueId), RequestDeviceError>
pub unsafe fn create_device_from_hal( &self, adapter_id: AdapterId, hal_device: DynOpenDevice, desc: &DeviceDescriptor<'_>, device_id_in: Option<DeviceId>, queue_id_in: Option<QueueId>, ) -> Result<(DeviceId, QueueId), RequestDeviceError>
§Safety
hal_devicemust be created fromadapter_idor its internal handle.descmust be a subset ofhal_devicefeatures and limits.
Source§impl Global
impl Global
pub fn surface_get_current_texture( &self, surface_id: SurfaceId, texture_id_in: Option<TextureId>, ) -> Result<SurfaceOutput, SurfaceError>
pub fn surface_present( &self, surface_id: SurfaceId, ) -> Result<Status, SurfaceError>
pub fn surface_texture_discard( &self, surface_id: SurfaceId, ) -> Result<(), SurfaceError>
pub fn surface_texture_release( &self, surface_id: SurfaceId, ) -> Result<(), SurfaceError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Global
impl !RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl !UnwindSafe for Global
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more