pub struct ContextWgpuCore(Arc<Global>);
Available on
wgpu_core
only.Tuple Fields§
§0: Arc<Global>
Implementations§
source§impl ContextWgpuCore
impl ContextWgpuCore
pub unsafe fn from_hal_instance<A: HalApi>(hal_instance: A::Instance) -> Self
sourcepub unsafe fn instance_as_hal<A: HalApi>(&self) -> Option<&A::Instance>
pub unsafe fn instance_as_hal<A: HalApi>(&self) -> Option<&A::Instance>
§Safety
- The raw instance handle returned must not be manually destroyed.
pub unsafe fn from_core_instance(core_instance: Instance) -> Self
pub fn enumerate_adapters(&self, backends: Backends) -> Vec<AdapterId>
Available on
native
only.pub unsafe fn create_adapter_from_hal<A: HalApi>( &self, hal_adapter: ExposedAdapter<A>, ) -> AdapterId
pub unsafe fn adapter_as_hal<A: HalApi, F: FnOnce(Option<&A::Adapter>) -> R, R>( &self, adapter: &CoreAdapter, hal_adapter_callback: F, ) -> R
pub unsafe fn buffer_as_hal<A: HalApi, F: FnOnce(Option<&A::Buffer>) -> R, R>( &self, buffer: &CoreBuffer, hal_buffer_callback: F, ) -> R
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>
pub unsafe fn create_texture_from_hal<A: HalApi>( &self, hal_texture: A::Texture, device: &CoreDevice, desc: &TextureDescriptor<'_>, ) -> CoreTexture
pub unsafe fn create_buffer_from_hal<A: HalApi>( &self, hal_buffer: A::Buffer, device: &CoreDevice, desc: &BufferDescriptor<'_>, ) -> CoreBuffer
pub unsafe fn device_as_hal<A: HalApi, F: FnOnce(Option<&A::Device>) -> R, R>( &self, device: &CoreDevice, hal_device_callback: F, ) -> R
pub unsafe fn surface_as_hal<A: HalApi, F: FnOnce(Option<&A::Surface>) -> R, R>( &self, surface: &CoreSurface, hal_surface_callback: F, ) -> R
pub unsafe fn texture_as_hal<A: HalApi, F: FnOnce(Option<&A::Texture>) -> R, R>( &self, texture: &CoreTexture, hal_texture_callback: F, ) -> R
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
sourcepub 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
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.
pub fn generate_report(&self) -> GlobalReport
fn handle_error_inner( &self, sink_mutex: &Mutex<ErrorSinkRaw>, source: ContextErrorSource, label: Label<'_>, fn_ident: &'static str, )
fn handle_error( &self, sink_mutex: &Mutex<ErrorSinkRaw>, source: impl Error + WasmNotSendSync + 'static, label: Label<'_>, fn_ident: &'static str, )
fn handle_error_nolabel( &self, sink_mutex: &Mutex<ErrorSinkRaw>, source: impl Error + WasmNotSendSync + 'static, fn_ident: &'static str, )
fn handle_error_fatal( &self, cause: impl Error + WasmNotSendSync + 'static, operation: &'static str, ) -> !
fn format_error(&self, err: &(dyn Error + 'static)) -> String
Trait Implementations§
source§impl Clone for ContextWgpuCore
impl Clone for ContextWgpuCore
source§fn clone(&self) -> ContextWgpuCore
fn clone(&self) -> ContextWgpuCore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ContextWgpuCore
impl Debug for ContextWgpuCore
source§impl Drop for ContextWgpuCore
impl Drop for ContextWgpuCore
source§impl From<<ContextWgpuCore as InterfaceTypes>::Adapter> for DispatchAdapter
impl From<<ContextWgpuCore as InterfaceTypes>::Adapter> for DispatchAdapter
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Adapter) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::BindGroup> for DispatchBindGroup
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::BindGroup) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::BindGroupLayout> for DispatchBindGroupLayout
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::BindGroupLayout) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Blas> for DispatchBlas
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Blas) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Buffer> for DispatchBuffer
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Buffer) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::BufferMappedRange> for DispatchBufferMappedRange
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::BufferMappedRange) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::CommandBuffer> for DispatchCommandBuffer
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::CommandBuffer) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::CommandEncoder> for DispatchCommandEncoder
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::CommandEncoder) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::ComputePass> for DispatchComputePass
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::ComputePass) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::ComputePipeline> for DispatchComputePipeline
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::ComputePipeline) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Device> for DispatchDevice
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Device) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Instance> for DispatchInstance
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Instance) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::PipelineCache> for DispatchPipelineCache
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::PipelineCache) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::PipelineLayout> for DispatchPipelineLayout
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::PipelineLayout) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::QuerySet> for DispatchQuerySet
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::QuerySet) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Queue> for DispatchQueue
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Queue) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::QueueWriteBuffer> for DispatchQueueWriteBuffer
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::QueueWriteBuffer) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::RenderBundle> for DispatchRenderBundle
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderBundle) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::RenderBundleEncoder> for DispatchRenderBundleEncoder
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderBundleEncoder) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::RenderPass> for DispatchRenderPass
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderPass) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::RenderPipeline> for DispatchRenderPipeline
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::RenderPipeline) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Sampler> for DispatchSampler
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Sampler) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::ShaderModule> for DispatchShaderModule
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::ShaderModule) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Surface> for DispatchSurface
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Surface) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::SurfaceOutputDetail> for DispatchSurfaceOutputDetail
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::SurfaceOutputDetail) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Texture> for DispatchTexture
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Texture) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::TextureView> for DispatchTextureView
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::TextureView) -> Self
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
impl From<<ContextWgpuCore as InterfaceTypes>::Tlas> for DispatchTlas
source§fn from(value: <ContextWgpuCore as InterfaceTypes>::Tlas) -> Self
fn from(value: <ContextWgpuCore as InterfaceTypes>::Tlas) -> Self
Converts to this type from the input type.
source§impl Hash for ContextWgpuCore
impl Hash for ContextWgpuCore
source§impl InstanceInterface for ContextWgpuCore
impl InstanceInterface for ContextWgpuCore
fn new(desc: &InstanceDescriptor) -> Selfwhere
Self: Sized,
unsafe fn create_surface( &self, target: SurfaceTargetUnsafe, ) -> Result<DispatchSurface, CreateSurfaceError>
fn request_adapter( &self, options: &RequestAdapterOptions<'_, '_>, ) -> Pin<Box<dyn RequestAdapterFuture>>
fn poll_all_devices(&self, force_wait: bool) -> bool
source§fn wgsl_language_features(&self) -> WgslLanguageFeatures
fn wgsl_language_features(&self) -> WgslLanguageFeatures
Available on crate feature
wgsl
only.source§impl InterfaceTypes for ContextWgpuCore
impl InterfaceTypes for ContextWgpuCore
type Instance = ContextWgpuCore
type Adapter = CoreAdapter
type Device = CoreDevice
type Queue = CoreQueue
type ShaderModule = CoreShaderModule
type BindGroupLayout = CoreBindGroupLayout
type BindGroup = CoreBindGroup
type TextureView = CoreTextureView
type Sampler = CoreSampler
type Buffer = CoreBuffer
type Texture = CoreTexture
type Blas = CoreBlas
type Tlas = CoreTlas
type QuerySet = CoreQuerySet
type PipelineLayout = CorePipelineLayout
type RenderPipeline = CoreRenderPipeline
type ComputePipeline = CoreComputePipeline
type PipelineCache = CorePipelineCache
type CommandEncoder = CoreCommandEncoder
type ComputePass = CoreComputePass
type RenderPass = CoreRenderPass
type CommandBuffer = CoreCommandBuffer
type RenderBundleEncoder = CoreRenderBundleEncoder
type RenderBundle = CoreRenderBundle
type Surface = CoreSurface
type SurfaceOutputDetail = CoreSurfaceOutputDetail
type QueueWriteBuffer = CoreQueueWriteBuffer
type BufferMappedRange = CoreBufferMappedRange
source§impl Ord for ContextWgpuCore
impl Ord for ContextWgpuCore
source§impl PartialEq for ContextWgpuCore
impl PartialEq for ContextWgpuCore
source§impl PartialOrd for ContextWgpuCore
impl PartialOrd for ContextWgpuCore
impl Eq for ContextWgpuCore
Auto Trait Implementations§
impl Freeze for ContextWgpuCore
impl !RefUnwindSafe for ContextWgpuCore
impl Send for ContextWgpuCore
impl Sync for ContextWgpuCore
impl Unpin for ContextWgpuCore
impl !UnwindSafe for ContextWgpuCore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.