Struct wgpu::core::global::Global

source ·
pub struct Global<G>{
    pub instance: Instance,
    pub surfaces: Registry<Id<Surface>, Surface>,
    /* private fields */
}

Fields§

§instance: Instance§surfaces: Registry<Id<Surface>, Surface>

Implementations§

source§

impl<G> Global<G>

source

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

source

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

source§

impl<G> Global<G>

source§

impl<G> Global<G>

source

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

source

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

source§

impl<G> Global<G>

source

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

source§

impl<G> Global<G>

source

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

source

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

source

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

source

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

source§

impl<G> Global<G>

source§

impl<G> Global<G>

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn create_buffer_error<A>( &self, id_in: <G as IdentityHandlerFactory<Id<Buffer<Api>>>>::Input, 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.

source

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

source

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

Assign id_in an error with the given label.

See create_buffer_error for more context and explaination.

source

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

source

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

source

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

source

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

source

pub unsafe fn create_texture_from_hal<A>( &self, hal_texture: <A as Api>::Texture, device_id: Id<Device<Api>>, desc: &TextureDescriptor<Option<Cow<'_, str>>, Vec<TextureFormat>>, id_in: <G as IdentityHandlerFactory<Id<Texture<Api>>>>::Input ) -> (Id<Texture<Api>>, 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
source

pub unsafe fn create_buffer_from_hal<A>( &self, hal_buffer: <A as Api>::Buffer, device_id: Id<Device<Api>>, desc: &BufferDescriptor<Option<Cow<'_, str>>>, id_in: <G as IdentityHandlerFactory<Id<Buffer<Api>>>>::Input ) -> (Id<Buffer<Api>>, 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
source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub unsafe fn device_create_shader_module_spirv<A>( &self, device_id: Id<Device<Api>>, desc: &ShaderModuleDescriptor<'_>, source: Cow<'_, [u32]>, id_in: <G as IdentityHandlerFactory<Id<ShaderModule<Api>>>>::Input ) -> (Id<ShaderModule<Api>>, 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.

source

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

source

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

source

pub fn device_create_command_encoder<A>( &self, device_id: Id<Device<Api>>, desc: &CommandEncoderDescriptor<Option<Cow<'_, str>>>, id_in: <G as IdentityHandlerFactory<Id<CommandBuffer<Api>>>>::Input ) -> (Id<CommandBuffer<Api>>, Option<DeviceError>)
where A: HalApi,

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn render_pipeline_get_bind_group_layout<A>( &self, pipeline_id: Id<RenderPipeline<Api>>, index: u32, id_in: <G as IdentityHandlerFactory<Id<BindGroupLayout<Api>>>>::Input ) -> (Id<BindGroupLayout<Api>>, 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.

source

pub fn render_pipeline_label<A>(&self, id: Id<RenderPipeline<Api>>) -> String
where A: HalApi,

source

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

source

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

source

pub fn compute_pipeline_get_bind_group_layout<A>( &self, pipeline_id: Id<ComputePipeline<Api>>, index: u32, id_in: <G as IdentityHandlerFactory<Id<BindGroupLayout<Api>>>>::Input ) -> (Id<BindGroupLayout<Api>>, 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.

source

pub fn compute_pipeline_label<A>(&self, id: Id<ComputePipeline<Api>>) -> String
where A: HalApi,

source

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

source

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

source

pub fn device_poll<A>( &self, device_id: Id<Device<Api>>, 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.

source

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.

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn buffer_map_async<A>( &self, buffer_id: Id<Buffer<Api>>, range: Range<u64>, op: BufferMapOperation ) -> Result<(), BufferAccessError>
where A: HalApi,

source

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

source

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

source§

impl<G> Global<G>

source

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

source

pub fn queue_create_staging_buffer<A>( &self, queue_id: Id<Device<Api>>, buffer_size: NonZeroU64, id_in: <G as IdentityHandlerFactory<Id<StagingBuffer<Api>>>>::Input ) -> Result<(Id<StagingBuffer<Api>>, *mut u8), QueueWriteError>
where A: HalApi,

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl<G> Global<G>

source

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

source

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

Safety

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

source

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.
source

pub unsafe fn from_instance(factory: G, instance: Instance) -> Global<G>

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

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

source

pub fn generate_report(&self) -> GlobalReport

source§

impl<G> Global<G>

source

pub unsafe fn instance_create_surface( &self, display_handle: RawDisplayHandle, window_handle: RawWindowHandle, id_in: <G as IdentityHandlerFactory<Id<Surface>>>::Input ) -> Result<Id<Surface>, InstanceError>

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.
source

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

source

pub fn enumerate_adapters( &self, inputs: AdapterInputs<'_, <G as IdentityHandlerFactory<Id<Adapter<Api>>>>::Input> ) -> Vec<Id<Adapter<Api>>>

source

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

source

pub unsafe fn create_adapter_from_hal<A>( &self, hal_adapter: ExposedAdapter<A>, input: <G as IdentityHandlerFactory<Id<Adapter<Api>>>>::Input ) -> Id<Adapter<Api>>
where A: HalApi,

Safety

hal_adapter must be created from this global internal instance handle.

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl<G> Global<G>

source

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

source

pub unsafe fn create_device_from_hal<A>( &self, adapter_id: Id<Adapter<Api>>, hal_device: OpenDevice<A>, desc: &DeviceDescriptor<Option<Cow<'_, str>>>, trace_path: Option<&Path>, device_id_in: <G as IdentityHandlerFactory<Id<Device<Api>>>>::Input, queue_id_in: <G as IdentityHandlerFactory<Id<Device<Api>>>>::Input ) -> (Id<Device<Api>>, Id<Device<Api>>, 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.
source§

impl<G> Global<G>

source

pub fn surface_get_current_texture<A>( &self, surface_id: Id<Surface>, texture_id_in: <G as IdentityHandlerFactory<Id<Texture<Api>>>>::Input ) -> Result<SurfaceOutput, SurfaceError>
where A: HalApi,

source

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

source

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

source§

impl<G> Global<G>

source

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

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

pub unsafe fn adapter_as_hal<A, F, R>( &self, id: Id<Adapter<Api>>, 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
source

pub unsafe fn device_as_hal<A, F, R>( &self, id: Id<Device<Api>>, 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
source

pub unsafe fn device_fence_as_hal<A, F, R>( &self, id: Id<Device<Api>>, 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
source

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

Trait Implementations§

source§

impl<G> Drop for Global<G>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<G> !RefUnwindSafe for Global<G>

§

impl<G> Send for Global<G>
where G: Send,

§

impl<G> Sync for Global<G>
where G: Sync,

§

impl<G> Unpin for Global<G>
where G: Unpin,

§

impl<G> !UnwindSafe for Global<G>

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
source§

impl<T> Downcast<T> for T

source§

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.
source§

impl<T> Upcast<T> for T

source§

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,