Struct iced::widget::shader::wgpu::core::global::Global

pub struct Global<G>{
    pub instance: Instance,
    pub surfaces: Registry<Id<Surface>, Surface>,
    /* private fields */
}
Available on crate feature wgpu only.

Fields§

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

Implementations§

§

impl<G> Global<G>

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,

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,

§

impl<G> Global<G>

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

§

impl<G> Global<G>

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,

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,

§

impl<G> Global<G>

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

§

impl<G> Global<G>

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,

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,

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,

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,

§

impl<G> Global<G>

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

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

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

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

§

impl<G> Global<G>

pub fn adapter_is_surface_supported<A>( &self, adapter_id: Id<Adapter<Api>>, 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<Api>> ) -> Result<SurfaceCapabilities, GetSurfaceSupportError>
where A: HalApi,

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

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

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

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,

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.

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

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.

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

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

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

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,

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

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

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

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

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

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,

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

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

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,

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

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

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,

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

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

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,

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

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

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,

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

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

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,

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.

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

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

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,

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

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

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

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

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,

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

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

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,

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

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

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,

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.

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

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

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,

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.

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

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

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

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.

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<Api>>) -> String
where A: HalApi,

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

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

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

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

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

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

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

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

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,

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

§

impl<G> Global<G>

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,

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,

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,

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,

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,

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

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

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

§

impl<G> Global<G>

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

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.

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(factory: G, instance: Instance) -> Global<G>

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<G> Global<G>

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>

Available on crate feature raw-window-handle only.
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<'_, <G as IdentityHandlerFactory<Id<Adapter<Api>>>>::Input> ) -> Vec<Id<Adapter<Api>>>

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

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.

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

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

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

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

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

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

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

§

impl<G> Global<G>

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,

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

impl<G> Global<G>

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,

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<G> Global<G>

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

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

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

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

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§

§

impl<G> Drop for Global<G>

§

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<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar> ) -> T

Converts self into C, using the provided parameters.
source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromAngle<T> for T

source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoAngle<U> for T
where U: FromAngle<T>,

source§

fn into_angle(self) -> U

Performs a conversion into T.
source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar> ) -> T

Converts self into C, using the provided parameters.
source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> IntoStimulus<T> for T

source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
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, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

impl<T> Upcast<T> for T

§

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

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

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

source§

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

§

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

§

impl<T> WasmNotSendSync for T

§

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