#[repr(C)]pub struct GPUDevice<D: DomTypes> {
eventtarget: D::EventTarget,
adapter: Dom<GPUAdapter<D>>,
extensions: Heap<*mut JSObject>,
features: Dom<GPUSupportedFeatures<D>>,
limits: Dom<GPUSupportedLimits<D>>,
adapter_info: Dom<GPUAdapterInfo<D>>,
label: DomRefCell<USVString>,
default_queue: Dom<D::GPUQueue>,
lost_promise: DomRefCell<<D::Promise as PromiseHelpers<D>>::HeapTraced>,
valid: Cell<bool>,
droppable: DroppableGPUDevice,
}Fields§
§eventtarget: D::EventTarget§adapter: Dom<GPUAdapter<D>>§extensions: Heap<*mut JSObject>§features: Dom<GPUSupportedFeatures<D>>§limits: Dom<GPUSupportedLimits<D>>§adapter_info: Dom<GPUAdapterInfo<D>>§label: DomRefCell<USVString>§default_queue: Dom<D::GPUQueue>§lost_promise: DomRefCell<<D::Promise as PromiseHelpers<D>>::HeapTraced>§valid: Cell<bool>§droppable: DroppableGPUDeviceImplementations§
Source§impl<D> GPUDevice<D>where
D: Equivalence,
<D::Promise as PromiseHelpers<D>>::StackRoot: WebGPUPromise<D>,
EventHandlerNonNull<D>: CallbackContainer<D>,
impl<D> GPUDevice<D>where
D: Equivalence,
<D::Promise as PromiseHelpers<D>>::StackRoot: WebGPUPromise<D>,
EventHandlerNonNull<D>: CallbackContainer<D>,
fn new_inherited( channel: WebGPU, adapter: &GPUAdapter<D>, features: &GPUSupportedFeatures<D>, limits: &GPUSupportedLimits<D>, adapter_info: &GPUAdapterInfo<D>, device: WebGPUDevice, queue: &D::GPUQueue, label: String, lost_promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, ) -> Self
pub fn new( cx: &mut JSContext, global: &D::GlobalScope, channel: WebGPU, adapter: &GPUAdapter<D>, extensions: HandleObject, features: Features, limits: Limits, device: WebGPUDevice, queue: WebGPUQueue, label: String, ) -> DomRoot<Self>
Source§impl<D> GPUDevice<D>where
D: Equivalence,
<D::Promise as PromiseHelpers<D>>::StackRoot: WebGPUPromise<D>,
EventHandlerNonNull<D>: CallbackContainer<D>,
impl<D> GPUDevice<D>where
D: Equivalence,
<D::Promise as PromiseHelpers<D>>::StackRoot: WebGPUPromise<D>,
EventHandlerNonNull<D>: CallbackContainer<D>,
pub fn id(&self) -> WebGPUDevice
pub fn queue_id(&self) -> WebGPUQueue
pub fn channel(&self) -> WebGPU
pub(crate) fn dispatch_error(&self, error: Error)
Sourcepub fn fire_uncaptured_error(&self, error: Error)
pub fn fire_uncaptured_error(&self, error: Error)
Sourcepub(crate) fn validate_texture_format_required_features(
&self,
format: &GPUTextureFormat,
) -> Fallible<TextureFormat>
pub(crate) fn validate_texture_format_required_features( &self, format: &GPUTextureFormat, ) -> Fallible<TextureFormat>
https://gpuweb.github.io/gpuweb/#abstract-opdef-validate-texture-format-required-features
Validates that the device suppports required features,
and if so returns an ok containing wgpu’s TextureFormat
pub(crate) fn is_lost(&self) -> bool
pub(crate) fn get_pipeline_layout_data( &self, layout: &GPUPipelineLayoutOrGPUAutoLayoutMode<D>, ) -> PipelineLayout
pub(crate) fn parse_render_pipeline<'a>( &self, descriptor: &GPURenderPipelineDescriptor<D>, ) -> Fallible<RenderPipelineDescriptor<'a>>
Sourcepub fn lose(&self, reason: GPUDeviceLostReason, msg: String)
pub fn lose(&self, reason: GPUDeviceLostReason, msg: String)
§impl<D: Equivalence> GPUDevice<D>
impl<D: Equivalence> GPUDevice<D>
fn __assert_parent_type(&self)
Trait Implementations§
§impl<D: DomTypes> Castable for GPUDevice<D>
impl<D: DomTypes> Castable for GPUDevice<D>
Source§impl<D: DomTypes> DomObject for GPUDevice<D>
impl<D: DomTypes> DomObject for GPUDevice<D>
type ReflectorType = <<D as DomTypes>::EventTarget as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Returns the receiver’s reflector.
Source§impl<D> GPUDeviceMethods<D> for GPUDevice<D>where
D: Equivalence,
<D::Promise as PromiseHelpers<D>>::StackRoot: WebGPUPromise<D>,
<D::Promise as PromiseHelpers<D>>::HeapTraced: HeapTracedPromiseHelpers<D>,
impl<D> GPUDeviceMethods<D> for GPUDevice<D>where
D: Equivalence,
<D::Promise as PromiseHelpers<D>>::StackRoot: WebGPUPromise<D>,
<D::Promise as PromiseHelpers<D>>::HeapTraced: HeapTracedPromiseHelpers<D>,
Source§fn Features(&self) -> DomRoot<GPUSupportedFeatures<D>>
fn Features(&self) -> DomRoot<GPUSupportedFeatures<D>>
Source§fn Limits(&self) -> DomRoot<GPUSupportedLimits<D>>
fn Limits(&self) -> DomRoot<GPUSupportedLimits<D>>
Source§fn AdapterInfo(&self) -> DomRoot<GPUAdapterInfo<D>>
fn AdapterInfo(&self) -> DomRoot<GPUAdapterInfo<D>>
Source§fn Lost(
&self,
cx: &JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn Lost( &self, cx: &JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
Source§fn CreateBuffer(
&self,
cx: &mut JSContext,
descriptor: &GPUBufferDescriptor,
) -> Fallible<DomRoot<GPUBuffer<D>>>
fn CreateBuffer( &self, cx: &mut JSContext, descriptor: &GPUBufferDescriptor, ) -> Fallible<DomRoot<GPUBuffer<D>>>
Source§fn CreateBindGroupLayout(
&self,
cx: &mut JSContext,
descriptor: &GPUBindGroupLayoutDescriptor,
) -> Fallible<DomRoot<GPUBindGroupLayout<D>>>
fn CreateBindGroupLayout( &self, cx: &mut JSContext, descriptor: &GPUBindGroupLayoutDescriptor, ) -> Fallible<DomRoot<GPUBindGroupLayout<D>>>
Source§fn CreatePipelineLayout(
&self,
cx: &mut JSContext,
descriptor: &GPUPipelineLayoutDescriptor<D>,
) -> DomRoot<GPUPipelineLayout<D>>
fn CreatePipelineLayout( &self, cx: &mut JSContext, descriptor: &GPUPipelineLayoutDescriptor<D>, ) -> DomRoot<GPUPipelineLayout<D>>
Source§fn CreateBindGroup(
&self,
cx: &mut JSContext,
descriptor: &GPUBindGroupDescriptor<D>,
) -> DomRoot<GPUBindGroup<D>>
fn CreateBindGroup( &self, cx: &mut JSContext, descriptor: &GPUBindGroupDescriptor<D>, ) -> DomRoot<GPUBindGroup<D>>
Source§fn CreateShaderModule(
&self,
cx: &mut CurrentRealm<'_>,
descriptor: RootedTraceableBox<GPUShaderModuleDescriptor>,
) -> DomRoot<GPUShaderModule<D>>
fn CreateShaderModule( &self, cx: &mut CurrentRealm<'_>, descriptor: RootedTraceableBox<GPUShaderModuleDescriptor>, ) -> DomRoot<GPUShaderModule<D>>
Source§fn CreateComputePipeline(
&self,
cx: &mut JSContext,
descriptor: &GPUComputePipelineDescriptor<D>,
) -> DomRoot<GPUComputePipeline<D>>
fn CreateComputePipeline( &self, cx: &mut JSContext, descriptor: &GPUComputePipelineDescriptor<D>, ) -> DomRoot<GPUComputePipeline<D>>
Source§fn CreateComputePipelineAsync(
&self,
cx: &mut CurrentRealm<'_>,
descriptor: &GPUComputePipelineDescriptor<D>,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn CreateComputePipelineAsync( &self, cx: &mut CurrentRealm<'_>, descriptor: &GPUComputePipelineDescriptor<D>, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
Source§fn CreateCommandEncoder(
&self,
cx: &mut JSContext,
descriptor: &GPUCommandEncoderDescriptor,
) -> DomRoot<GPUCommandEncoder<D>>
fn CreateCommandEncoder( &self, cx: &mut JSContext, descriptor: &GPUCommandEncoderDescriptor, ) -> DomRoot<GPUCommandEncoder<D>>
Source§fn CreateTexture(
&self,
cx: &mut JSContext,
descriptor: &GPUTextureDescriptor,
) -> Fallible<DomRoot<GPUTexture<D>>>
fn CreateTexture( &self, cx: &mut JSContext, descriptor: &GPUTextureDescriptor, ) -> Fallible<DomRoot<GPUTexture<D>>>
Source§fn CreateSampler(
&self,
cx: &mut JSContext,
descriptor: &GPUSamplerDescriptor,
) -> DomRoot<GPUSampler<D>>
fn CreateSampler( &self, cx: &mut JSContext, descriptor: &GPUSamplerDescriptor, ) -> DomRoot<GPUSampler<D>>
Source§fn CreateRenderPipeline(
&self,
cx: &mut JSContext,
descriptor: &GPURenderPipelineDescriptor<D>,
) -> Fallible<DomRoot<GPURenderPipeline<D>>>
fn CreateRenderPipeline( &self, cx: &mut JSContext, descriptor: &GPURenderPipelineDescriptor<D>, ) -> Fallible<DomRoot<GPURenderPipeline<D>>>
Source§fn CreateRenderPipelineAsync(
&self,
cx: &mut CurrentRealm<'_>,
descriptor: &GPURenderPipelineDescriptor<D>,
) -> Fallible<<<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot>
fn CreateRenderPipelineAsync( &self, cx: &mut CurrentRealm<'_>, descriptor: &GPURenderPipelineDescriptor<D>, ) -> Fallible<<<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot>
Source§fn CreateRenderBundleEncoder(
&self,
cx: &mut JSContext,
descriptor: &GPURenderBundleEncoderDescriptor,
) -> Fallible<DomRoot<GPURenderBundleEncoder<D>>>
fn CreateRenderBundleEncoder( &self, cx: &mut JSContext, descriptor: &GPURenderBundleEncoderDescriptor, ) -> Fallible<DomRoot<GPURenderBundleEncoder<D>>>
Source§fn CreateQuerySet(
&self,
cx: &mut JSContext,
descriptor: &GPUQuerySetDescriptor,
) -> Fallible<DomRoot<GPUQuerySet<D>>>
fn CreateQuerySet( &self, cx: &mut JSContext, descriptor: &GPUQuerySetDescriptor, ) -> Fallible<DomRoot<GPUQuerySet<D>>>
Source§fn ImportExternalTexture(
&self,
cx: &mut JSContext,
descriptor: &GPUExternalTextureDescriptor<D>,
) -> Fallible<DomRoot<GPUExternalTexture<D>>>
fn ImportExternalTexture( &self, cx: &mut JSContext, descriptor: &GPUExternalTextureDescriptor<D>, ) -> Fallible<DomRoot<GPUExternalTexture<D>>>
Source§fn PushErrorScope(&self, filter: GPUErrorFilter)
fn PushErrorScope(&self, filter: GPUErrorFilter)
Source§fn PopErrorScope(
&self,
cx: &mut CurrentRealm<'_>,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn PopErrorScope( &self, cx: &mut CurrentRealm<'_>, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn GetOnuncapturederror( &self, cx: &mut JSContext, ) -> Option<Rc<EventHandlerNonNull<D>>>
fn SetOnuncapturederror( &self, cx: &mut JSContext, listener: Option<Rc<EventHandlerNonNull<D>>>, )
Source§impl<D: DomTypes> HasParent for GPUDevice<D>
impl<D: DomTypes> HasParent for GPUDevice<D>
Source§fn as_parent(&self) -> &D::EventTarget
fn as_parent(&self) -> &D::EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = <D as DomTypes>::EventTarget
§impl<D: DomTypes> IDLInterface for GPUDevice<D>
impl<D: DomTypes> IDLInterface for GPUDevice<D>
§const PROTO_FIRST: u16 = 190
const PROTO_FIRST: u16 = 190
First prototype ID in the DFS-ordered range for this interface and its descendants.
§const PROTO_LAST: u16 = 190
const PROTO_LAST: u16 = 190
Last prototype ID in the DFS-ordered range for this interface and its descendants.
Source§impl<D> MallocSizeOf for GPUDevice<D>where
D: MallocSizeOf + DomTypes,
impl<D> MallocSizeOf for GPUDevice<D>where
D: MallocSizeOf + DomTypes,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl<D: DomTypes> MutDomObject for GPUDevice<D>
impl<D: DomTypes> MutDomObject for GPUDevice<D>
Source§impl<D: DomTypes> ToJSValConvertible for GPUDevice<D>
impl<D: DomTypes> ToJSValConvertible for GPUDevice<D>
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
Convert
self to a JSVal. JSAPI failure causes a panic.§impl<D: DomTypes> WeakReferenceable for GPUDevice<D>
impl<D: DomTypes> WeakReferenceable for GPUDevice<D>
impl<D: DomTypes> DerivedFrom<<D as DomTypes>::EventTarget> for GPUDevice<D>
impl<D: DomTypes> Eq for GPUDevice<D>
Auto Trait Implementations§
impl<D> !Freeze for GPUDevice<D>
impl<D> !RefUnwindSafe for GPUDevice<D>
impl<D> !Send for GPUDevice<D>
impl<D> !Sync for GPUDevice<D>
impl<D> Unpin for GPUDevice<D>where
<D as DomTypes>::EventTarget: Unpin,
<<D as DomTypes>::Promise as PromiseHelpers<D>>::HeapTraced: Unpin,
impl<D> UnsafeUnpin for GPUDevice<D>where
<D as DomTypes>::EventTarget: UnsafeUnpin,
<<D as DomTypes>::Promise as PromiseHelpers<D>>::HeapTraced: UnsafeUnpin,
impl<D> !UnwindSafe for GPUDevice<D>
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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
Returns the [
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert