wgpu::backend::wgpu_core

Struct ContextWgpuCore

source
pub struct ContextWgpuCore(Arc<Global>);
Available on wgpu_core only.

Tuple Fields§

§0: Arc<Global>

Implementations§

source§

impl ContextWgpuCore

source

pub unsafe fn from_hal_instance<A: HalApi>(hal_instance: A::Instance) -> Self

source

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

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

pub unsafe fn from_core_instance(core_instance: Instance) -> Self

source

pub fn enumerate_adapters(&self, backends: Backends) -> Vec<AdapterId>

Available on native only.
source

pub unsafe fn create_adapter_from_hal<A: HalApi>( &self, hal_adapter: ExposedAdapter<A>, ) -> AdapterId

source

pub unsafe fn adapter_as_hal<A: HalApi, F: FnOnce(Option<&A::Adapter>) -> R, R>( &self, adapter: &CoreAdapter, hal_adapter_callback: F, ) -> R

source

pub unsafe fn buffer_as_hal<A: HalApi, F: FnOnce(Option<&A::Buffer>) -> R, R>( &self, buffer: &CoreBuffer, hal_buffer_callback: F, ) -> R

source

pub unsafe fn create_device_from_hal<A: HalApi>( &self, adapter: &CoreAdapter, hal_device: OpenDevice<A>, desc: &DeviceDescriptor<'_>, trace_dir: Option<&Path>, ) -> Result<(CoreDevice, CoreQueue), RequestDeviceError>

source

pub unsafe fn create_texture_from_hal<A: HalApi>( &self, hal_texture: A::Texture, device: &CoreDevice, desc: &TextureDescriptor<'_>, ) -> CoreTexture

source

pub unsafe fn create_buffer_from_hal<A: HalApi>( &self, hal_buffer: A::Buffer, device: &CoreDevice, desc: &BufferDescriptor<'_>, ) -> CoreBuffer

source

pub unsafe fn device_as_hal<A: HalApi, F: FnOnce(Option<&A::Device>) -> R, R>( &self, device: &CoreDevice, hal_device_callback: F, ) -> R

source

pub unsafe fn surface_as_hal<A: HalApi, F: FnOnce(Option<&A::Surface>) -> R, R>( &self, surface: &CoreSurface, hal_surface_callback: F, ) -> R

source

pub unsafe fn texture_as_hal<A: HalApi, F: FnOnce(Option<&A::Texture>) -> R, R>( &self, texture: &CoreTexture, hal_texture_callback: F, ) -> R

source

pub unsafe fn texture_view_as_hal<A: HalApi, F: FnOnce(Option<&A::TextureView>) -> R, R>( &self, texture_view: &CoreTextureView, hal_texture_view_callback: F, ) -> R

source

pub unsafe fn command_encoder_as_hal_mut<A: HalApi, F: FnOnce(Option<&mut A::CommandEncoder>) -> R, R>( &self, command_encoder: &CoreCommandEncoder, hal_command_encoder_callback: F, ) -> R

This method will start the wgpu_core level command recording.

source

pub fn generate_report(&self) -> GlobalReport

source

fn handle_error_inner( &self, sink_mutex: &Mutex<ErrorSinkRaw>, source: ContextErrorSource, label: Label<'_>, fn_ident: &'static str, )

source

fn handle_error( &self, sink_mutex: &Mutex<ErrorSinkRaw>, source: impl Error + WasmNotSendSync + 'static, label: Label<'_>, fn_ident: &'static str, )

source

fn handle_error_nolabel( &self, sink_mutex: &Mutex<ErrorSinkRaw>, source: impl Error + WasmNotSendSync + 'static, fn_ident: &'static str, )

source

fn handle_error_fatal( &self, cause: impl Error + WasmNotSendSync + 'static, operation: &'static str, ) -> !

source

fn format_error(&self, err: &(dyn Error + 'static)) -> String

Trait Implementations§

source§

impl Clone for ContextWgpuCore

source§

fn clone(&self) -> ContextWgpuCore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ContextWgpuCore

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for ContextWgpuCore

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Adapter> for DispatchAdapter

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Adapter) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::BindGroup> for DispatchBindGroup

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::BindGroup) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::BindGroupLayout> for DispatchBindGroupLayout

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::BindGroupLayout) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Blas> for DispatchBlas

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Blas) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Buffer> for DispatchBuffer

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Buffer) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::BufferMappedRange> for DispatchBufferMappedRange

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::BufferMappedRange) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::CommandBuffer> for DispatchCommandBuffer

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::CommandBuffer) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::CommandEncoder> for DispatchCommandEncoder

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::CommandEncoder) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::ComputePass> for DispatchComputePass

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::ComputePass) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::ComputePipeline> for DispatchComputePipeline

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::ComputePipeline) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Device> for DispatchDevice

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Device) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Instance> for DispatchInstance

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Instance) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::PipelineCache> for DispatchPipelineCache

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::PipelineCache) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::PipelineLayout> for DispatchPipelineLayout

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::PipelineLayout) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::QuerySet> for DispatchQuerySet

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::QuerySet) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Queue> for DispatchQueue

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Queue) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::QueueWriteBuffer> for DispatchQueueWriteBuffer

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::QueueWriteBuffer) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::RenderBundle> for DispatchRenderBundle

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderBundle) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::RenderBundleEncoder> for DispatchRenderBundleEncoder

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderBundleEncoder) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::RenderPass> for DispatchRenderPass

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderPass) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::RenderPipeline> for DispatchRenderPipeline

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderPipeline) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Sampler> for DispatchSampler

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Sampler) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::ShaderModule> for DispatchShaderModule

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::ShaderModule) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Surface> for DispatchSurface

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Surface) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::SurfaceOutputDetail> for DispatchSurfaceOutputDetail

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::SurfaceOutputDetail) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Texture> for DispatchTexture

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Texture) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::TextureView> for DispatchTextureView

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::TextureView) -> Self

Converts to this type from the input type.
source§

impl From<<ContextWgpuCore as InterfaceTypes>::Tlas> for DispatchTlas

source§

fn from(value: <ContextWgpuCore as InterfaceTypes>::Tlas) -> Self

Converts to this type from the input type.
source§

impl Hash for ContextWgpuCore

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl InstanceInterface for ContextWgpuCore

source§

fn new(desc: &InstanceDescriptor) -> Self
where Self: Sized,

source§

unsafe fn create_surface( &self, target: SurfaceTargetUnsafe, ) -> Result<DispatchSurface, CreateSurfaceError>

source§

fn request_adapter( &self, options: &RequestAdapterOptions<'_, '_>, ) -> Pin<Box<dyn RequestAdapterFuture>>

source§

fn poll_all_devices(&self, force_wait: bool) -> bool

source§

fn wgsl_language_features(&self) -> WgslLanguageFeatures

Available on crate feature wgsl only.
source§

impl InterfaceTypes for ContextWgpuCore

source§

impl Ord for ContextWgpuCore

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for ContextWgpuCore

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ContextWgpuCore

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for ContextWgpuCore

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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,