Struct wgpu::core::global::Global

pub struct Global {
    pub instance: Instance,
    /* private fields */
}
Available on wgpu_core only.

Fields§

§instance: Instance

Implementations§

§

impl Global

pub fn command_encoder_clear_buffer<A>( &self, command_encoder_id: Id<CommandEncoder>, dst: Id<Buffer>, offset: u64, size: Option<u64> ) -> Result<(), ClearError>
where A: HalApi,

pub fn command_encoder_clear_texture<A>( &self, command_encoder_id: Id<CommandEncoder>, dst: Id<Texture>, subresource_range: &ImageSubresourceRange ) -> Result<(), ClearError>
where A: HalApi,

§

impl Global

pub fn command_encoder_run_compute_pass<A>( &self, encoder_id: Id<CommandEncoder>, pass: &ComputePass ) -> Result<(), ComputePassError>
where A: HalApi,

§

impl Global

pub fn command_encoder_write_timestamp<A>( &self, command_encoder_id: Id<CommandEncoder>, query_set_id: Id<QuerySet>, query_index: u32 ) -> Result<(), QueryError>
where A: HalApi,

pub fn command_encoder_resolve_query_set<A>( &self, command_encoder_id: Id<CommandEncoder>, query_set_id: Id<QuerySet>, start_query: u32, query_count: u32, destination: Id<Buffer>, destination_offset: u64 ) -> Result<(), QueryError>
where A: HalApi,

§

impl Global

pub fn command_encoder_run_render_pass<A>( &self, encoder_id: Id<CommandEncoder>, pass: &RenderPass ) -> Result<(), RenderPassError>
where A: HalApi,

§

impl Global

pub fn command_encoder_copy_buffer_to_buffer<A>( &self, command_encoder_id: Id<CommandEncoder>, source: Id<Buffer>, source_offset: u64, destination: Id<Buffer>, destination_offset: u64, size: u64 ) -> Result<(), CopyError>
where A: HalApi,

pub fn command_encoder_copy_buffer_to_texture<A>( &self, command_encoder_id: Id<CommandEncoder>, source: &ImageCopyBuffer<Id<Buffer>>, destination: &ImageCopyTexture<Id<Texture>>, copy_size: &Extent3d ) -> Result<(), CopyError>
where A: HalApi,

pub fn command_encoder_copy_texture_to_buffer<A>( &self, command_encoder_id: Id<CommandEncoder>, source: &ImageCopyTexture<Id<Texture>>, destination: &ImageCopyBuffer<Id<Buffer>>, copy_size: &Extent3d ) -> Result<(), CopyError>
where A: HalApi,

pub fn command_encoder_copy_texture_to_texture<A>( &self, command_encoder_id: Id<CommandEncoder>, source: &ImageCopyTexture<Id<Texture>>, destination: &ImageCopyTexture<Id<Texture>>, copy_size: &Extent3d ) -> Result<(), CopyError>
where A: HalApi,

§

impl Global

pub fn command_encoder_finish<A>( &self, encoder_id: Id<CommandEncoder>, _desc: &CommandBufferDescriptor<Option<Cow<'_, str>>> ) -> (Id<CommandBuffer>, Option<CommandEncoderError>)
where A: HalApi,

pub fn command_encoder_push_debug_group<A>( &self, encoder_id: Id<CommandEncoder>, label: &str ) -> Result<(), CommandEncoderError>
where A: HalApi,

pub fn command_encoder_insert_debug_marker<A>( &self, encoder_id: Id<CommandEncoder>, label: &str ) -> Result<(), CommandEncoderError>
where A: HalApi,

pub fn command_encoder_pop_debug_group<A>( &self, encoder_id: Id<CommandEncoder> ) -> Result<(), CommandEncoderError>
where A: HalApi,

§

impl Global

pub fn adapter_is_surface_supported<A>( &self, adapter_id: Id<Adapter>, surface_id: Id<Surface> ) -> Result<bool, IsSurfaceSupportedError>
where A: HalApi,

pub fn surface_get_capabilities<A>( &self, surface_id: Id<Surface>, adapter_id: Id<Adapter> ) -> Result<SurfaceCapabilities, GetSurfaceSupportError>
where A: HalApi,

pub fn device_features<A>( &self, device_id: Id<Device> ) -> Result<Features, InvalidDevice>
where A: HalApi,

pub fn device_limits<A>( &self, device_id: Id<Device> ) -> Result<Limits, InvalidDevice>
where A: HalApi,

pub fn device_downlevel_properties<A>( &self, device_id: Id<Device> ) -> Result<DownlevelCapabilities, InvalidDevice>
where A: HalApi,

pub fn device_create_buffer<A>( &self, device_id: Id<Device>, desc: &BufferDescriptor<Option<Cow<'_, str>>>, id_in: Option<Id<Buffer>> ) -> (Id<Buffer>, Option<CreateBufferError>)
where A: HalApi,

pub fn create_buffer_error<A>( &self, id_in: Option<Id<Buffer>>, label: Option<Cow<'_, str>> )
where A: HalApi,

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.

pub fn create_render_bundle_error<A>( &self, id_in: Option<Id<RenderBundle>>, label: Option<Cow<'_, str>> )
where A: HalApi,

pub fn create_texture_error<A>( &self, id_in: Option<Id<Texture>>, label: Option<Cow<'_, str>> )
where A: HalApi,

Assign id_in an error with the given label.

See create_buffer_error for more context and explanation.

pub fn device_wait_for_buffer<A>( &self, device_id: Id<Device>, buffer_id: Id<Buffer> ) -> Result<(), WaitIdleError>
where A: HalApi,

Available on crate feature replay only.

pub fn buffer_label<A>(&self, id: Id<Buffer>) -> String
where A: HalApi,

pub fn buffer_destroy<A>( &self, buffer_id: Id<Buffer> ) -> Result<(), DestroyError>
where A: HalApi,

pub fn buffer_drop<A>(&self, buffer_id: Id<Buffer>, wait: bool)
where A: HalApi,

pub fn device_create_texture<A>( &self, device_id: Id<Device>, desc: &TextureDescriptor<Option<Cow<'_, str>>, Vec<TextureFormat>>, id_in: Option<Id<Texture>> ) -> (Id<Texture>, Option<CreateTextureError>)
where A: HalApi,

pub unsafe fn create_texture_from_hal<A>( &self, hal_texture: <A as Api>::Texture, device_id: Id<Device>, desc: &TextureDescriptor<Option<Cow<'_, str>>, Vec<TextureFormat>>, id_in: Option<Id<Texture>> ) -> (Id<Texture>, Option<CreateTextureError>)
where A: HalApi,

Safety
  • hal_texture must be created from device_id corresponding raw handle.
  • hal_texture must be created respecting desc
  • hal_texture must be initialized

pub unsafe fn create_buffer_from_hal<A>( &self, hal_buffer: <A as Api>::Buffer, device_id: Id<Device>, desc: &BufferDescriptor<Option<Cow<'_, str>>>, id_in: Option<Id<Buffer>> ) -> (Id<Buffer>, Option<CreateBufferError>)
where A: HalApi,

Safety
  • hal_buffer must be created from device_id corresponding raw handle.
  • hal_buffer must be created respecting desc
  • hal_buffer must be initialized

pub fn texture_label<A>(&self, id: Id<Texture>) -> String
where A: HalApi,

pub fn texture_destroy<A>( &self, texture_id: Id<Texture> ) -> Result<(), DestroyError>
where A: HalApi,

pub fn texture_drop<A>(&self, texture_id: Id<Texture>, wait: bool)
where A: HalApi,

pub fn texture_create_view<A>( &self, texture_id: Id<Texture>, desc: &TextureViewDescriptor<'_>, id_in: Option<Id<TextureView>> ) -> (Id<TextureView>, Option<CreateTextureViewError>)
where A: HalApi,

pub fn texture_view_label<A>(&self, id: Id<TextureView>) -> String
where A: HalApi,

pub fn texture_view_drop<A>( &self, texture_view_id: Id<TextureView>, wait: bool ) -> Result<(), TextureViewDestroyError>
where A: HalApi,

pub fn device_create_sampler<A>( &self, device_id: Id<Device>, desc: &SamplerDescriptor<'_>, id_in: Option<Id<Sampler>> ) -> (Id<Sampler>, Option<CreateSamplerError>)
where A: HalApi,

pub fn sampler_label<A>(&self, id: Id<Sampler>) -> String
where A: HalApi,

pub fn sampler_drop<A>(&self, sampler_id: Id<Sampler>)
where A: HalApi,

pub fn device_create_bind_group_layout<A>( &self, device_id: Id<Device>, desc: &BindGroupLayoutDescriptor<'_>, id_in: Option<Id<BindGroupLayout>> ) -> (Id<BindGroupLayout>, Option<CreateBindGroupLayoutError>)
where A: HalApi,

pub fn bind_group_layout_label<A>(&self, id: Id<BindGroupLayout>) -> String
where A: HalApi,

pub fn bind_group_layout_drop<A>( &self, bind_group_layout_id: Id<BindGroupLayout> )
where A: HalApi,

pub fn device_create_pipeline_layout<A>( &self, device_id: Id<Device>, desc: &PipelineLayoutDescriptor<'_>, id_in: Option<Id<PipelineLayout>> ) -> (Id<PipelineLayout>, Option<CreatePipelineLayoutError>)
where A: HalApi,

pub fn pipeline_layout_label<A>(&self, id: Id<PipelineLayout>) -> String
where A: HalApi,

pub fn pipeline_layout_drop<A>(&self, pipeline_layout_id: Id<PipelineLayout>)
where A: HalApi,

pub fn device_create_bind_group<A>( &self, device_id: Id<Device>, desc: &BindGroupDescriptor<'_>, id_in: Option<Id<BindGroup>> ) -> (Id<BindGroup>, Option<CreateBindGroupError>)
where A: HalApi,

pub fn bind_group_label<A>(&self, id: Id<BindGroup>) -> String
where A: HalApi,

pub fn bind_group_drop<A>(&self, bind_group_id: Id<BindGroup>)
where A: HalApi,

pub fn device_create_shader_module<A>( &self, device_id: Id<Device>, desc: &ShaderModuleDescriptor<'_>, source: ShaderModuleSource<'_>, id_in: Option<Id<ShaderModule>> ) -> (Id<ShaderModule>, Option<CreateShaderModuleError>)
where A: HalApi,

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.

pub unsafe fn device_create_shader_module_spirv<A>( &self, device_id: Id<Device>, desc: &ShaderModuleDescriptor<'_>, source: Cow<'_, [u32]>, id_in: Option<Id<ShaderModule>> ) -> (Id<ShaderModule>, Option<CreateShaderModuleError>)
where A: HalApi,

Safety

This function passes SPIR-V binary to the backend as-is and can potentially result in a driver crash.

pub fn shader_module_label<A>(&self, id: Id<ShaderModule>) -> String
where A: HalApi,

pub fn shader_module_drop<A>(&self, shader_module_id: Id<ShaderModule>)
where A: HalApi,

pub fn device_create_command_encoder<A>( &self, device_id: Id<Device>, desc: &CommandEncoderDescriptor<Option<Cow<'_, str>>>, id_in: Option<Id<CommandEncoder>> ) -> (Id<CommandEncoder>, Option<DeviceError>)
where A: HalApi,

pub fn command_buffer_label<A>(&self, id: Id<CommandBuffer>) -> String
where A: HalApi,

pub fn command_encoder_drop<A>(&self, command_encoder_id: Id<CommandEncoder>)
where A: HalApi,

pub fn command_buffer_drop<A>(&self, command_buffer_id: Id<CommandBuffer>)
where A: HalApi,

pub fn device_create_render_bundle_encoder( &self, device_id: Id<Device>, desc: &RenderBundleEncoderDescriptor<'_> ) -> (*mut RenderBundleEncoder, Option<CreateRenderBundleError>)

pub fn render_bundle_encoder_finish<A>( &self, bundle_encoder: RenderBundleEncoder, desc: &RenderBundleDescriptor<Option<Cow<'_, str>>>, id_in: Option<Id<RenderBundle>> ) -> (Id<RenderBundle>, Option<RenderBundleError>)
where A: HalApi,

pub fn render_bundle_label<A>(&self, id: Id<RenderBundle>) -> String
where A: HalApi,

pub fn render_bundle_drop<A>(&self, render_bundle_id: Id<RenderBundle>)
where A: HalApi,

pub fn device_create_query_set<A>( &self, device_id: Id<Device>, desc: &QuerySetDescriptor<Option<Cow<'_, str>>>, id_in: Option<Id<QuerySet>> ) -> (Id<QuerySet>, Option<CreateQuerySetError>)
where A: HalApi,

pub fn query_set_drop<A>(&self, query_set_id: Id<QuerySet>)
where A: HalApi,

pub fn query_set_label<A>(&self, id: Id<QuerySet>) -> String
where A: HalApi,

pub fn device_create_render_pipeline<A>( &self, device_id: Id<Device>, desc: &RenderPipelineDescriptor<'_>, id_in: Option<Id<RenderPipeline>>, implicit_pipeline_ids: Option<ImplicitPipelineIds<'_>> ) -> (Id<RenderPipeline>, Option<CreateRenderPipelineError>)
where A: HalApi,

pub fn render_pipeline_get_bind_group_layout<A>( &self, pipeline_id: Id<RenderPipeline>, index: u32, id_in: Option<Id<BindGroupLayout>> ) -> (Id<BindGroupLayout>, Option<GetBindGroupLayoutError>)
where A: HalApi,

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_label<A>(&self, id: Id<RenderPipeline>) -> String
where A: HalApi,

pub fn render_pipeline_drop<A>(&self, render_pipeline_id: Id<RenderPipeline>)
where A: HalApi,

pub fn device_create_compute_pipeline<A>( &self, device_id: Id<Device>, desc: &ComputePipelineDescriptor<'_>, id_in: Option<Id<ComputePipeline>>, implicit_pipeline_ids: Option<ImplicitPipelineIds<'_>> ) -> (Id<ComputePipeline>, Option<CreateComputePipelineError>)
where A: HalApi,

pub fn compute_pipeline_get_bind_group_layout<A>( &self, pipeline_id: Id<ComputePipeline>, index: u32, id_in: Option<Id<BindGroupLayout>> ) -> (Id<BindGroupLayout>, Option<GetBindGroupLayoutError>)
where A: HalApi,

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_label<A>(&self, id: Id<ComputePipeline>) -> String
where A: HalApi,

pub fn compute_pipeline_drop<A>(&self, compute_pipeline_id: Id<ComputePipeline>)
where A: HalApi,

pub fn surface_configure<A>( &self, surface_id: Id<Surface>, device_id: Id<Device>, config: &SurfaceConfiguration<Vec<TextureFormat>> ) -> Option<ConfigureSurfaceError>
where A: HalApi,

pub fn device_maintain_ids<A>( &self, device_id: Id<Device> ) -> Result<(), InvalidDevice>
where A: HalApi,

Available on crate feature replay only.

Only triangle suspected resource IDs. This helps us to avoid ID collisions upon creating new resources when re-playing a trace.

pub fn device_poll<A>( &self, device_id: Id<Device>, maintain: Maintain<WrappedSubmissionIndex> ) -> Result<bool, WaitIdleError>
where A: HalApi,

Check device_id for freeable resources and completed buffer mappings.

Return queue_empty indicating whether there are more queue submissions still in flight.

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.

pub fn device_label<A>(&self, id: Id<Device>) -> String
where A: HalApi,

pub fn device_start_capture<A>(&self, id: Id<Device>)
where A: HalApi,

pub fn device_stop_capture<A>(&self, id: Id<Device>)
where A: HalApi,

pub fn device_make_invalid<A>(&self, device_id: Id<Device>)
where A: HalApi,

pub fn device_drop<A>(&self, device_id: Id<Device>)
where A: HalApi,

pub fn device_set_device_lost_closure<A>( &self, device_id: Id<Device>, device_lost_closure: DeviceLostClosure )
where A: HalApi,

pub fn device_destroy<A>(&self, device_id: Id<Device>)
where A: HalApi,

pub fn device_mark_lost<A>(&self, device_id: Id<Device>, message: &str)
where A: HalApi,

pub fn queue_drop<A>(&self, queue_id: Id<Queue>)
where A: HalApi,

pub fn buffer_map_async<A>( &self, buffer_id: Id<Buffer>, offset: u64, size: Option<u64>, op: BufferMapOperation ) -> Result<(), BufferAccessError>
where A: HalApi,

pub fn buffer_get_mapped_range<A>( &self, buffer_id: Id<Buffer>, offset: u64, size: Option<u64> ) -> Result<(*mut u8, u64), BufferAccessError>
where A: HalApi,

pub fn buffer_unmap<A>( &self, buffer_id: Id<Buffer> ) -> Result<(), BufferAccessError>
where A: HalApi,

§

impl Global

pub fn queue_write_buffer<A>( &self, queue_id: Id<Queue>, buffer_id: Id<Buffer>, buffer_offset: u64, data: &[u8] ) -> Result<(), QueueWriteError>
where A: HalApi,

pub fn queue_create_staging_buffer<A>( &self, queue_id: Id<Queue>, buffer_size: NonZeroU64, id_in: Option<Id<StagingBuffer>> ) -> Result<(Id<StagingBuffer>, *mut u8), QueueWriteError>
where A: HalApi,

pub fn queue_write_staging_buffer<A>( &self, queue_id: Id<Queue>, buffer_id: Id<Buffer>, buffer_offset: u64, staging_buffer_id: Id<StagingBuffer> ) -> Result<(), QueueWriteError>
where A: HalApi,

pub fn queue_validate_write_buffer<A>( &self, _queue_id: Id<Queue>, buffer_id: Id<Buffer>, buffer_offset: u64, buffer_size: u64 ) -> Result<(), QueueWriteError>
where A: HalApi,

pub fn queue_write_texture<A>( &self, queue_id: Id<Queue>, destination: &ImageCopyTexture<Id<Texture>>, data: &[u8], data_layout: &ImageDataLayout, size: &Extent3d ) -> Result<(), QueueWriteError>
where A: HalApi,

pub fn queue_submit<A>( &self, queue_id: Id<Queue>, command_buffer_ids: &[Id<CommandBuffer>] ) -> Result<WrappedSubmissionIndex, QueueSubmitError>
where A: HalApi,

pub fn queue_get_timestamp_period<A>( &self, queue_id: Id<Queue> ) -> Result<f32, InvalidQueue>
where A: HalApi,

pub fn queue_on_submitted_work_done<A>( &self, queue_id: Id<Queue>, closure: SubmittedWorkDoneClosure ) -> Result<(), InvalidQueue>
where A: HalApi,

§

impl Global

pub fn new(name: &str, instance_desc: InstanceDescriptor) -> Global

pub unsafe fn from_hal_instance<A>( name: &str, hal_instance: <A as Api>::Instance ) -> Global
where A: HalApi,

Safety

Refer to the creation of wgpu-hal Instance for every backend.

pub unsafe fn instance_as_hal<A>(&self) -> Option<&<A as Api>::Instance>
where A: HalApi,

Safety
  • The raw instance handle returned must not be manually destroyed.

pub unsafe fn from_instance(instance: Instance) -> Global

Safety
  • The raw handles obtained from the Instance must not be manually destroyed

pub fn clear_backend<A>(&self, _dummy: ())
where A: HalApi,

pub fn generate_report(&self) -> GlobalReport

§

impl Global

pub unsafe fn instance_create_surface( &self, display_handle: RawDisplayHandle, window_handle: RawWindowHandle, id_in: Option<Id<Surface>> ) -> Result<Id<Surface>, CreateSurfaceError>

Available on crate feature raw-window-handle only.

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_handle must be a valid object to create a surface upon.
  • window_handle must remain valid as long as the returned SurfaceId is being used.

pub fn surface_drop(&self, id: Id<Surface>)

pub fn enumerate_adapters( &self, inputs: AdapterInputs<'_, Adapter> ) -> Vec<Id<Adapter>>

pub fn request_adapter( &self, desc: &RequestAdapterOptions<Id<Surface>>, inputs: AdapterInputs<'_, Adapter> ) -> Result<Id<Adapter>, RequestAdapterError>

pub unsafe fn create_adapter_from_hal<A>( &self, hal_adapter: ExposedAdapter<A>, input: Option<Id<Adapter>> ) -> Id<Adapter>
where A: HalApi,

Safety

hal_adapter must be created from this global internal instance handle.

pub fn adapter_get_info<A>( &self, adapter_id: Id<Adapter> ) -> Result<AdapterInfo, InvalidAdapter>
where A: HalApi,

pub fn adapter_get_texture_format_features<A>( &self, adapter_id: Id<Adapter>, format: TextureFormat ) -> Result<TextureFormatFeatures, InvalidAdapter>
where A: HalApi,

pub fn adapter_features<A>( &self, adapter_id: Id<Adapter> ) -> Result<Features, InvalidAdapter>
where A: HalApi,

pub fn adapter_limits<A>( &self, adapter_id: Id<Adapter> ) -> Result<Limits, InvalidAdapter>
where A: HalApi,

pub fn adapter_downlevel_capabilities<A>( &self, adapter_id: Id<Adapter> ) -> Result<DownlevelCapabilities, InvalidAdapter>
where A: HalApi,

pub fn adapter_get_presentation_timestamp<A>( &self, adapter_id: Id<Adapter> ) -> Result<PresentationTimestamp, InvalidAdapter>
where A: HalApi,

pub fn adapter_drop<A>(&self, adapter_id: Id<Adapter>)
where A: HalApi,

§

impl Global

pub fn adapter_request_device<A>( &self, adapter_id: Id<Adapter>, desc: &DeviceDescriptor<Option<Cow<'_, str>>>, trace_path: Option<&Path>, device_id_in: Option<Id<Device>>, queue_id_in: Option<Id<Queue>> ) -> (Id<Device>, Id<Queue>, Option<RequestDeviceError>)
where A: HalApi,

pub unsafe fn create_device_from_hal<A>( &self, adapter_id: Id<Adapter>, hal_device: OpenDevice<A>, desc: &DeviceDescriptor<Option<Cow<'_, str>>>, trace_path: Option<&Path>, device_id_in: Option<Id<Device>>, queue_id_in: Option<Id<Queue>> ) -> (Id<Device>, Id<Queue>, Option<RequestDeviceError>)
where A: HalApi,

Safety
  • hal_device must be created from adapter_id or its internal handle.
  • desc must be a subset of hal_device features and limits.
§

impl Global

pub fn surface_get_current_texture<A>( &self, surface_id: Id<Surface>, texture_id_in: Option<Id<Texture>> ) -> Result<SurfaceOutput, SurfaceError>
where A: HalApi,

pub fn surface_present<A>( &self, surface_id: Id<Surface> ) -> Result<SurfaceStatus, SurfaceError>
where A: HalApi,

pub fn surface_texture_discard<A>( &self, surface_id: Id<Surface> ) -> Result<(), SurfaceError>
where A: HalApi,

§

impl Global

pub unsafe fn texture_as_hal<A, F, R>( &self, id: Id<Texture>, hal_texture_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&<A as Api>::Texture>) -> R,

Safety
  • The raw texture handle must not be manually destroyed

pub unsafe fn texture_view_as_hal<A, F, R>( &self, id: Id<TextureView>, hal_texture_view_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&<A as Api>::TextureView>) -> R,

Safety
  • The raw texture view handle must not be manually destroyed

pub unsafe fn adapter_as_hal<A, F, R>( &self, id: Id<Adapter>, hal_adapter_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&<A as Api>::Adapter>) -> R,

Safety
  • The raw adapter handle must not be manually destroyed

pub unsafe fn device_as_hal<A, F, R>( &self, id: Id<Device>, hal_device_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&<A as Api>::Device>) -> R,

Safety
  • The raw device handle must not be manually destroyed

pub unsafe fn device_fence_as_hal<A, F, R>( &self, id: Id<Device>, hal_fence_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&<A as Api>::Fence>) -> R,

Safety
  • The raw fence handle must not be manually destroyed

pub unsafe fn surface_as_hal<A, F, R>( &self, id: Id<Surface>, hal_surface_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&<A as Api>::Surface>) -> R,

Safety
  • The raw surface handle must not be manually destroyed

pub unsafe fn command_encoder_as_hal_mut<A, F, R>( &self, id: Id<CommandEncoder>, hal_command_encoder_callback: F ) -> R
where A: HalApi, F: FnOnce(Option<&mut <A as Api>::CommandEncoder>) -> R,

Safety
  • The raw command encoder handle must not be manually destroyed

Trait Implementations§

§

impl Drop for Global

§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,