#[repr(C)]pub struct GPUDevice {
eventtarget: EventTarget,
channel: WebGPU,
adapter: Dom<GPUAdapter>,
extensions: Heap<*mut JSObject>,
features: Dom<GPUSupportedFeatures>,
limits: Dom<GPUSupportedLimits>,
label: DomRefCell<USVString>,
device: WebGPUDevice,
default_queue: Dom<GPUQueue>,
lost_promise: DomRefCell<Rc<Promise>>,
valid: Cell<bool>,
}
Fields§
§eventtarget: EventTarget
§channel: WebGPU
§adapter: Dom<GPUAdapter>
§extensions: Heap<*mut JSObject>
§features: Dom<GPUSupportedFeatures>
§limits: Dom<GPUSupportedLimits>
§label: DomRefCell<USVString>
§device: WebGPUDevice
§default_queue: Dom<GPUQueue>
§lost_promise: DomRefCell<Rc<Promise>>
§valid: Cell<bool>
Implementations§
source§impl GPUDevice
impl GPUDevice
fn __assert_parent_type(&self)
source§impl GPUDevice
impl GPUDevice
fn new_inherited( channel: WebGPU, adapter: &GPUAdapter, extensions: Heap<*mut JSObject>, features: &GPUSupportedFeatures, limits: &GPUSupportedLimits, device: WebGPUDevice, queue: &GPUQueue, label: String, lost_promise: Rc<Promise>, ) -> Self
pub fn new( global: &GlobalScope, channel: WebGPU, adapter: &GPUAdapter, extensions: Heap<*mut JSObject>, features: Features, limits: Limits, device: WebGPUDevice, queue: WebGPUQueue, label: String, can_gc: CanGc, ) -> Root<Dom<Self>>
source§impl GPUDevice
impl GPUDevice
pub fn id(&self) -> WebGPUDevice
pub fn queue_id(&self) -> WebGPUQueue
pub fn channel(&self) -> WebGPU
pub fn dispatch_error(&self, error: Error)
pub fn fire_uncaptured_error(&self, error: Error, can_gc: CanGc)
sourcepub fn validate_texture_format_required_features(
&self,
format: &GPUTextureFormat,
) -> Result<TextureFormat, Error>
pub fn validate_texture_format_required_features( &self, format: &GPUTextureFormat, ) -> Result<TextureFormat, Error>
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 fn is_lost(&self) -> bool
pub fn get_pipeline_layout_data( &self, layout: &GPUPipelineLayoutOrGPUAutoLayoutMode, ) -> PipelineLayout
pub fn parse_render_pipeline<'a>( &self, descriptor: &GPURenderPipelineDescriptor, ) -> Result<(PipelineLayout, RenderPipelineDescriptor<'a>), Error>
sourcepub fn lose(&self, reason: GPUDeviceLostReason, msg: String)
pub fn lose(&self, reason: GPUDeviceLostReason, msg: String)
Trait Implementations§
source§impl AsyncWGPUListener for GPUDevice
impl AsyncWGPUListener for GPUDevice
fn handle_response( &self, response: WebGPUResponse, promise: &Rc<Promise>, can_gc: CanGc, )
source§impl Castable for GPUDevice
impl Castable for GPUDevice
source§impl DomObjectWrap for GPUDevice
impl DomObjectWrap for GPUDevice
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::WebGPUBinding::GPUDevice_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::webgpu::gpudevice::GPUDevice>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::webgpu::gpudevice::GPUDevice>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::WebGPUBinding::GPUDevice_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::webgpu::gpudevice::GPUDevice>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::webgpu::gpudevice::GPUDevice>>}
Function pointer to the general wrap function type
source§impl GPUDeviceMethods<DomTypeHolder> for GPUDevice
impl GPUDeviceMethods<DomTypeHolder> for GPUDevice
source§fn CreateBuffer(
&self,
descriptor: &GPUBufferDescriptor,
) -> Result<Root<Dom<GPUBuffer>>, Error>
fn CreateBuffer( &self, descriptor: &GPUBufferDescriptor, ) -> Result<Root<Dom<GPUBuffer>>, Error>
source§fn CreateBindGroupLayout(
&self,
descriptor: &GPUBindGroupLayoutDescriptor,
) -> Result<Root<Dom<GPUBindGroupLayout>>, Error>
fn CreateBindGroupLayout( &self, descriptor: &GPUBindGroupLayoutDescriptor, ) -> Result<Root<Dom<GPUBindGroupLayout>>, Error>
source§fn CreatePipelineLayout(
&self,
descriptor: &GPUPipelineLayoutDescriptor,
) -> Root<Dom<GPUPipelineLayout>>
fn CreatePipelineLayout( &self, descriptor: &GPUPipelineLayoutDescriptor, ) -> Root<Dom<GPUPipelineLayout>>
source§fn CreateBindGroup(
&self,
descriptor: &GPUBindGroupDescriptor,
) -> Root<Dom<GPUBindGroup>>
fn CreateBindGroup( &self, descriptor: &GPUBindGroupDescriptor, ) -> Root<Dom<GPUBindGroup>>
source§fn CreateShaderModule(
&self,
descriptor: RootedTraceableBox<GPUShaderModuleDescriptor>,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Root<Dom<GPUShaderModule>>
fn CreateShaderModule( &self, descriptor: RootedTraceableBox<GPUShaderModuleDescriptor>, comp: InRealm<'_>, can_gc: CanGc, ) -> Root<Dom<GPUShaderModule>>
source§fn CreateComputePipeline(
&self,
descriptor: &GPUComputePipelineDescriptor,
) -> Root<Dom<GPUComputePipeline>>
fn CreateComputePipeline( &self, descriptor: &GPUComputePipelineDescriptor, ) -> Root<Dom<GPUComputePipeline>>
source§fn CreateComputePipelineAsync(
&self,
descriptor: &GPUComputePipelineDescriptor,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn CreateComputePipelineAsync( &self, descriptor: &GPUComputePipelineDescriptor, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
source§fn CreateCommandEncoder(
&self,
descriptor: &GPUCommandEncoderDescriptor,
) -> Root<Dom<GPUCommandEncoder>>
fn CreateCommandEncoder( &self, descriptor: &GPUCommandEncoderDescriptor, ) -> Root<Dom<GPUCommandEncoder>>
source§fn CreateTexture(
&self,
descriptor: &GPUTextureDescriptor,
) -> Result<Root<Dom<GPUTexture>>, Error>
fn CreateTexture( &self, descriptor: &GPUTextureDescriptor, ) -> Result<Root<Dom<GPUTexture>>, Error>
source§fn CreateSampler(
&self,
descriptor: &GPUSamplerDescriptor,
) -> Root<Dom<GPUSampler>>
fn CreateSampler( &self, descriptor: &GPUSamplerDescriptor, ) -> Root<Dom<GPUSampler>>
source§fn CreateRenderPipeline(
&self,
descriptor: &GPURenderPipelineDescriptor,
) -> Result<Root<Dom<GPURenderPipeline>>, Error>
fn CreateRenderPipeline( &self, descriptor: &GPURenderPipelineDescriptor, ) -> Result<Root<Dom<GPURenderPipeline>>, Error>
source§fn CreateRenderPipelineAsync(
&self,
descriptor: &GPURenderPipelineDescriptor,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Result<Rc<Promise>, Error>
fn CreateRenderPipelineAsync( &self, descriptor: &GPURenderPipelineDescriptor, comp: InRealm<'_>, can_gc: CanGc, ) -> Result<Rc<Promise>, Error>
source§fn CreateRenderBundleEncoder(
&self,
descriptor: &GPURenderBundleEncoderDescriptor,
) -> Result<Root<Dom<GPURenderBundleEncoder>>, Error>
fn CreateRenderBundleEncoder( &self, descriptor: &GPURenderBundleEncoderDescriptor, ) -> Result<Root<Dom<GPURenderBundleEncoder>>, Error>
source§fn PushErrorScope(&self, filter: GPUErrorFilter)
fn PushErrorScope(&self, filter: GPUErrorFilter)
fn GetOnuncapturederror(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnuncapturederror(&self, listener: Option<Rc<EventHandlerNonNull>>)
source§impl HasParent for GPUDevice
impl HasParent for GPUDevice
source§fn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &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 = EventTarget
source§impl IDLInterface for GPUDevice
impl IDLInterface for GPUDevice
source§impl MallocSizeOf for GPUDevice
impl MallocSizeOf for GPUDevice
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 MutDomObject for GPUDevice
impl MutDomObject for GPUDevice
source§impl PartialEq for GPUDevice
impl PartialEq for GPUDevice
source§impl ToJSValConvertible for GPUDevice
impl ToJSValConvertible for GPUDevice
source§impl WeakReferenceable for GPUDevice
impl WeakReferenceable for GPUDevice
impl DerivedFrom<EventTarget> for GPUDevice
impl Eq for GPUDevice
Auto Trait Implementations§
impl !Freeze for GPUDevice
impl !RefUnwindSafe for GPUDevice
impl !Send for GPUDevice
impl !Sync for GPUDevice
impl Unpin for GPUDevice
impl !UnwindSafe for GPUDevice
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<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<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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
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