Struct wgpu_hal::empty::Context

source ·
pub struct Context;

Trait Implementations§

source§

impl Adapter for Context

source§

type A = Api

source§

unsafe fn open( &self, features: Features, _limits: &Limits, _memory_hints: &MemoryHints, ) -> Result<OpenDevice<Api>, DeviceError>

source§

unsafe fn texture_format_capabilities( &self, format: TextureFormat, ) -> TextureFormatCapabilities

Return the set of supported capabilities for a texture format.
source§

unsafe fn surface_capabilities( &self, surface: &Context, ) -> Option<SurfaceCapabilities>

Returns the capabilities of working with a specified surface. Read more
source§

unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp

Creates a PresentationTimestamp using the adapter’s WSI.
source§

impl Device for Context

source§

type A = Api

source§

unsafe fn create_buffer( &self, desc: &BufferDescriptor<'_>, ) -> Result<Resource, DeviceError>

Creates a new buffer. Read more
source§

unsafe fn destroy_buffer(&self, buffer: Resource)

Free buffer and any GPU resources it owns. Read more
source§

unsafe fn add_raw_buffer(&self, _buffer: &Resource)

A hook for when a wgpu-core buffer is created from a raw wgpu-hal buffer.
source§

unsafe fn map_buffer( &self, buffer: &Resource, range: MemoryRange, ) -> Result<BufferMapping, DeviceError>

Return a pointer to CPU memory mapping the contents of buffer. Read more
source§

unsafe fn unmap_buffer(&self, buffer: &Resource)

Remove the mapping established by the last call to Device::map_buffer. Read more
source§

unsafe fn flush_mapped_ranges<I>(&self, buffer: &Resource, ranges: I)

Indicate that CPU writes to mapped buffer memory should be made visible to the GPU. Read more
source§

unsafe fn invalidate_mapped_ranges<I>(&self, buffer: &Resource, ranges: I)

Indicate that GPU writes to mapped buffer memory should be made visible to the CPU. Read more
source§

unsafe fn create_texture( &self, desc: &TextureDescriptor<'_>, ) -> Result<Resource, DeviceError>

Creates a new texture. Read more
source§

unsafe fn destroy_texture(&self, texture: Resource)

source§

unsafe fn add_raw_texture(&self, _texture: &Resource)

A hook for when a wgpu-core texture is created from a raw wgpu-hal texture.
source§

unsafe fn create_texture_view( &self, texture: &Resource, desc: &TextureViewDescriptor<'_>, ) -> Result<Resource, DeviceError>

source§

unsafe fn destroy_texture_view(&self, view: Resource)

source§

unsafe fn create_sampler( &self, desc: &SamplerDescriptor<'_>, ) -> Result<Resource, DeviceError>

source§

unsafe fn destroy_sampler(&self, sampler: Resource)

source§

unsafe fn create_command_encoder( &self, desc: &CommandEncoderDescriptor<'_, Context>, ) -> Result<Encoder, DeviceError>

Create a fresh CommandEncoder. Read more
source§

unsafe fn create_bind_group_layout( &self, desc: &BindGroupLayoutDescriptor<'_>, ) -> Result<Resource, DeviceError>

Creates a bind group layout.
source§

unsafe fn destroy_bind_group_layout(&self, bg_layout: Resource)

source§

unsafe fn create_pipeline_layout( &self, desc: &PipelineLayoutDescriptor<'_, Resource>, ) -> Result<Resource, DeviceError>

source§

unsafe fn destroy_pipeline_layout(&self, pipeline_layout: Resource)

source§

unsafe fn create_bind_group( &self, desc: &BindGroupDescriptor<'_, Resource, Resource, Resource, Resource, Resource>, ) -> Result<Resource, DeviceError>

source§

unsafe fn destroy_bind_group(&self, group: Resource)

source§

unsafe fn create_shader_module( &self, desc: &ShaderModuleDescriptor<'_>, shader: ShaderInput<'_>, ) -> Result<Resource, ShaderError>

source§

unsafe fn destroy_shader_module(&self, module: Resource)

source§

unsafe fn create_render_pipeline( &self, desc: &RenderPipelineDescriptor<'_, Resource, Resource, Resource>, ) -> Result<Resource, PipelineError>

source§

unsafe fn destroy_render_pipeline(&self, pipeline: Resource)

source§

unsafe fn create_compute_pipeline( &self, desc: &ComputePipelineDescriptor<'_, Resource, Resource, Resource>, ) -> Result<Resource, PipelineError>

source§

unsafe fn destroy_compute_pipeline(&self, pipeline: Resource)

source§

unsafe fn create_pipeline_cache( &self, desc: &PipelineCacheDescriptor<'_>, ) -> Result<Resource, PipelineCacheError>

source§

unsafe fn destroy_pipeline_cache(&self, cache: Resource)

source§

unsafe fn create_query_set( &self, desc: &QuerySetDescriptor<Label<'_>>, ) -> Result<Resource, DeviceError>

source§

unsafe fn destroy_query_set(&self, set: Resource)

source§

unsafe fn create_fence(&self) -> Result<Resource, DeviceError>

source§

unsafe fn destroy_fence(&self, fence: Resource)

source§

unsafe fn get_fence_value( &self, fence: &Resource, ) -> Result<FenceValue, DeviceError>

source§

unsafe fn wait( &self, fence: &Resource, value: FenceValue, timeout_ms: u32, ) -> Result<bool, DeviceError>

Wait for fence to reach value. Read more
source§

unsafe fn start_capture(&self) -> bool

source§

unsafe fn stop_capture(&self)

source§

unsafe fn create_acceleration_structure( &self, desc: &AccelerationStructureDescriptor<'_>, ) -> Result<Resource, DeviceError>

source§

unsafe fn get_acceleration_structure_build_sizes<'a>( &self, _desc: &GetAccelerationStructureBuildSizesDescriptor<'a, Resource>, ) -> AccelerationStructureBuildSizes

source§

unsafe fn get_acceleration_structure_device_address( &self, _acceleration_structure: &Resource, ) -> BufferAddress

source§

unsafe fn destroy_acceleration_structure( &self, _acceleration_structure: Resource, )

source§

fn tlas_instance_to_bytes(&self, instance: TlasInstance) -> Vec<u8>

source§

fn get_internal_counters(&self) -> HalCounters

source§

fn pipeline_cache_validation_key(&self) -> Option<[u8; 16]>

source§

unsafe fn pipeline_cache_get_data( &self, cache: &<Self::A as Api>::PipelineCache, ) -> Option<Vec<u8>>

source§

fn generate_allocator_report(&self) -> Option<AllocatorReport>

source§

impl DynResource for Context

source§

fn as_any(&self) -> &dyn Any

source§

fn as_any_mut(&mut self) -> &mut dyn Any

source§

impl Instance for Context

source§

type A = Api

source§

unsafe fn init(desc: &InstanceDescriptor<'_>) -> Result<Self, InstanceError>

source§

unsafe fn create_surface( &self, _display_handle: RawDisplayHandle, _window_handle: RawWindowHandle, ) -> Result<Context, InstanceError>

source§

unsafe fn enumerate_adapters( &self, _surface_hint: Option<&Context>, ) -> Vec<ExposedAdapter<Api>>

surface_hint is only used by the GLES backend targeting WebGL2
source§

impl Queue for Context

source§

type A = Api

source§

unsafe fn submit( &self, command_buffers: &[&Resource], surface_textures: &[&Resource], signal_fence: (&mut Resource, FenceValue), ) -> Result<(), DeviceError>

Submit command_buffers for execution on GPU. Read more
source§

unsafe fn present( &self, surface: &Context, texture: Resource, ) -> Result<(), SurfaceError>

source§

unsafe fn get_timestamp_period(&self) -> f32

source§

impl Surface for Context

source§

type A = Api

source§

unsafe fn configure( &self, device: &Context, config: &SurfaceConfiguration, ) -> Result<(), SurfaceError>

Configure self to use device. Read more
source§

unsafe fn unconfigure(&self, device: &Context)

Unconfigure self on device. Read more
source§

unsafe fn acquire_texture( &self, timeout: Option<Duration>, fence: &Resource, ) -> Result<Option<AcquiredSurfaceTexture<Api>>, SurfaceError>

Return the next texture to be presented by self, for the caller to draw on. Read more
source§

unsafe fn discard_texture(&self, texture: Resource)

Relinquish an acquired texture without presenting it. Read more

Auto Trait Implementations§

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<A> DynAdapter for A
where A: Adapter + DynResource,

source§

unsafe fn open( &self, features: Features, limits: &Limits, memory_hints: &MemoryHints, ) -> Result<DynOpenDevice, DeviceError>

source§

unsafe fn texture_format_capabilities( &self, format: TextureFormat, ) -> TextureFormatCapabilities

source§

unsafe fn surface_capabilities( &self, surface: &(dyn DynSurface + 'static), ) -> Option<SurfaceCapabilities>

source§

unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp

source§

impl<D> DynDevice for D
where D: Device + DynResource,

source§

unsafe fn create_buffer( &self, desc: &BufferDescriptor<'_>, ) -> Result<Box<dyn DynBuffer>, DeviceError>

source§

unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>)

source§

unsafe fn add_raw_buffer(&self, buffer: &(dyn DynBuffer + 'static))

source§

unsafe fn map_buffer( &self, buffer: &(dyn DynBuffer + 'static), range: Range<u64>, ) -> Result<BufferMapping, DeviceError>

source§

unsafe fn unmap_buffer(&self, buffer: &(dyn DynBuffer + 'static))

source§

unsafe fn flush_mapped_ranges( &self, buffer: &(dyn DynBuffer + 'static), ranges: &[Range<u64>], )

source§

unsafe fn invalidate_mapped_ranges( &self, buffer: &(dyn DynBuffer + 'static), ranges: &[Range<u64>], )

source§

unsafe fn create_texture( &self, desc: &TextureDescriptor<'_>, ) -> Result<Box<dyn DynTexture>, DeviceError>

source§

unsafe fn destroy_texture(&self, texture: Box<dyn DynTexture>)

source§

unsafe fn add_raw_texture(&self, texture: &(dyn DynTexture + 'static))

source§

unsafe fn create_texture_view( &self, texture: &(dyn DynTexture + 'static), desc: &TextureViewDescriptor<'_>, ) -> Result<Box<dyn DynTextureView>, DeviceError>

source§

unsafe fn destroy_texture_view(&self, view: Box<dyn DynTextureView>)

source§

unsafe fn create_sampler( &self, desc: &SamplerDescriptor<'_>, ) -> Result<Box<dyn DynSampler>, DeviceError>

source§

unsafe fn destroy_sampler(&self, sampler: Box<dyn DynSampler>)

source§

unsafe fn create_command_encoder( &self, desc: &CommandEncoderDescriptor<'_, dyn DynQueue>, ) -> Result<Box<dyn DynCommandEncoder>, DeviceError>

source§

unsafe fn create_bind_group_layout( &self, desc: &BindGroupLayoutDescriptor<'_>, ) -> Result<Box<dyn DynBindGroupLayout>, DeviceError>

source§

unsafe fn destroy_bind_group_layout( &self, bg_layout: Box<dyn DynBindGroupLayout>, )

source§

unsafe fn create_pipeline_layout( &self, desc: &PipelineLayoutDescriptor<'_, dyn DynBindGroupLayout>, ) -> Result<Box<dyn DynPipelineLayout>, DeviceError>

source§

unsafe fn destroy_pipeline_layout( &self, pipeline_layout: Box<dyn DynPipelineLayout>, )

source§

unsafe fn create_bind_group( &self, desc: &BindGroupDescriptor<'_, dyn DynBindGroupLayout, dyn DynBuffer, dyn DynSampler, dyn DynTextureView, dyn DynAccelerationStructure>, ) -> Result<Box<dyn DynBindGroup>, DeviceError>

source§

unsafe fn destroy_bind_group(&self, group: Box<dyn DynBindGroup>)

source§

unsafe fn create_shader_module( &self, desc: &ShaderModuleDescriptor<'_>, shader: ShaderInput<'_>, ) -> Result<Box<dyn DynShaderModule>, ShaderError>

source§

unsafe fn destroy_shader_module(&self, module: Box<dyn DynShaderModule>)

source§

unsafe fn create_render_pipeline( &self, desc: &RenderPipelineDescriptor<'_, dyn DynPipelineLayout, dyn DynShaderModule, dyn DynPipelineCache>, ) -> Result<Box<dyn DynRenderPipeline>, PipelineError>

source§

unsafe fn destroy_render_pipeline(&self, pipeline: Box<dyn DynRenderPipeline>)

source§

unsafe fn create_compute_pipeline( &self, desc: &ComputePipelineDescriptor<'_, dyn DynPipelineLayout, dyn DynShaderModule, dyn DynPipelineCache>, ) -> Result<Box<dyn DynComputePipeline>, PipelineError>

source§

unsafe fn destroy_compute_pipeline(&self, pipeline: Box<dyn DynComputePipeline>)

source§

unsafe fn create_pipeline_cache( &self, desc: &PipelineCacheDescriptor<'_>, ) -> Result<Box<dyn DynPipelineCache>, PipelineCacheError>

source§

fn pipeline_cache_validation_key(&self) -> Option<[u8; 16]>

source§

unsafe fn destroy_pipeline_cache( &self, pipeline_cache: Box<dyn DynPipelineCache>, )

source§

unsafe fn create_query_set( &self, desc: &QuerySetDescriptor<Option<&str>>, ) -> Result<Box<dyn DynQuerySet>, DeviceError>

source§

unsafe fn destroy_query_set(&self, query_set: Box<dyn DynQuerySet>)

source§

unsafe fn create_fence(&self) -> Result<Box<dyn DynFence>, DeviceError>

source§

unsafe fn destroy_fence(&self, fence: Box<dyn DynFence>)

source§

unsafe fn get_fence_value( &self, fence: &(dyn DynFence + 'static), ) -> Result<u64, DeviceError>

source§

unsafe fn wait( &self, fence: &(dyn DynFence + 'static), value: u64, timeout_ms: u32, ) -> Result<bool, DeviceError>

source§

unsafe fn start_capture(&self) -> bool

source§

unsafe fn stop_capture(&self)

source§

unsafe fn pipeline_cache_get_data( &self, cache: &(dyn DynPipelineCache + 'static), ) -> Option<Vec<u8>>

source§

unsafe fn create_acceleration_structure( &self, desc: &AccelerationStructureDescriptor<'_>, ) -> Result<Box<dyn DynAccelerationStructure>, DeviceError>

source§

unsafe fn get_acceleration_structure_build_sizes( &self, desc: &GetAccelerationStructureBuildSizesDescriptor<'_, dyn DynBuffer>, ) -> AccelerationStructureBuildSizes

source§

unsafe fn get_acceleration_structure_device_address( &self, acceleration_structure: &(dyn DynAccelerationStructure + 'static), ) -> u64

source§

unsafe fn destroy_acceleration_structure( &self, acceleration_structure: Box<dyn DynAccelerationStructure>, )

source§

fn tlas_instance_to_bytes(&self, instance: TlasInstance) -> Vec<u8>

source§

fn get_internal_counters(&self) -> HalCounters

source§

fn generate_allocator_report(&self) -> Option<AllocatorReport>

source§

impl<I> DynInstance for I
where I: Instance + DynResource,

source§

unsafe fn create_surface( &self, display_handle: RawDisplayHandle, window_handle: RawWindowHandle, ) -> Result<Box<dyn DynSurface>, InstanceError>

source§

unsafe fn enumerate_adapters( &self, surface_hint: Option<&(dyn DynSurface + 'static)>, ) -> Vec<DynExposedAdapter>

source§

impl<Q> DynQueue for Q
where Q: Queue + DynResource,

source§

unsafe fn submit( &self, command_buffers: &[&(dyn DynCommandBuffer + 'static)], surface_textures: &[&(dyn DynSurfaceTexture + 'static)], signal_fence: (&mut (dyn DynFence + 'static), u64), ) -> Result<(), DeviceError>

source§

unsafe fn present( &self, surface: &(dyn DynSurface + 'static), texture: Box<dyn DynSurfaceTexture>, ) -> Result<(), SurfaceError>

source§

unsafe fn get_timestamp_period(&self) -> f32

source§

impl<S> DynSurface for S
where S: Surface + DynResource,

source§

unsafe fn configure( &self, device: &(dyn DynDevice + 'static), config: &SurfaceConfiguration, ) -> Result<(), SurfaceError>

source§

unsafe fn unconfigure(&self, device: &(dyn DynDevice + 'static))

source§

unsafe fn acquire_texture( &self, timeout: Option<Duration>, fence: &(dyn DynFence + 'static), ) -> Result<Option<DynAcquiredSurfaceTexture>, SurfaceError>

source§

unsafe fn discard_texture(&self, texture: Box<dyn DynSurfaceTexture>)

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>,

source§

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>,

source§

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,