#[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>,
scope_context: DomRefCell<ScopeContext>,
lost_promise: DomRefCell<Option<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>
§scope_context: DomRefCell<ScopeContext>
§lost_promise: DomRefCell<Option<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
) -> Self
pub fn new(
global: &GlobalScope,
channel: WebGPU,
adapter: &GPUAdapter,
extensions: Heap<*mut JSObject>,
features: Features,
limits: Limits,
device: WebGPUDevice,
queue: WebGPUQueue,
label: String
) -> Root<Dom<Self>>
source§impl GPUDevice
impl GPUDevice
pub fn id(&self) -> WebGPUDevice
pub fn handle_server_msg(
&self,
scope: Option<ErrorScopeId>,
result: WebGPUOpResult
)
fn handle_error(&self, scope: ErrorScopeId, error: GPUError)
fn try_remove_scope(&self, scope: ErrorScopeId)
fn fire_uncaptured_error(&self, err: GPUError)
pub fn use_current_scope(&self) -> Option<ErrorScopeId>
fn get_pipeline_layout_data(
&self,
layout: &GPUPipelineLayoutOrGPUAutoLayoutMode
) -> (Option<PipelineLayoutId>, Option<(PipelineLayoutId, Vec<BindGroupLayoutId>)>, Vec<WebGPUBindGroupLayout>)
sourcepub fn lose(&self, reason: GPUDeviceLostReason)
pub fn lose(&self, reason: GPUDeviceLostReason)
https://gpuweb.github.io/gpuweb/#lose-the-device
Trait Implementations§
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>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::GPUDeviceBinding::GPUDeviceBinding::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::gpudevice::GPUDevice>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::gpudevice::GPUDevice>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::GPUDeviceBinding::GPUDeviceBinding::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::gpudevice::GPUDevice>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::gpudevice::GPUDevice>>}
source§impl GPUDeviceMethods for GPUDevice
impl GPUDeviceMethods for GPUDevice
source§fn Features(&self) -> Root<Dom<GPUSupportedFeatures>>
fn Features(&self) -> Root<Dom<GPUSupportedFeatures>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-features
source§fn Limits(&self) -> Root<Dom<GPUSupportedLimits>>
fn Limits(&self) -> Root<Dom<GPUSupportedLimits>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-limits
source§fn GetQueue(&self) -> Root<Dom<GPUQueue>>
fn GetQueue(&self) -> Root<Dom<GPUQueue>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-queue
source§fn GetLost(&self, comp: InRealm<'_>) -> Result<Rc<Promise>, Error>
fn GetLost(&self, comp: InRealm<'_>) -> Result<Rc<Promise>, Error>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-lost
source§fn CreateBuffer(
&self,
descriptor: &GPUBufferDescriptor
) -> Result<Root<Dom<GPUBuffer>>, Error>
fn CreateBuffer(
&self,
descriptor: &GPUBufferDescriptor
) -> Result<Root<Dom<GPUBuffer>>, Error>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createbuffer
source§fn CreateBindGroupLayout(
&self,
descriptor: &GPUBindGroupLayoutDescriptor
) -> Root<Dom<GPUBindGroupLayout>>
fn CreateBindGroupLayout(
&self,
descriptor: &GPUBindGroupLayoutDescriptor
) -> Root<Dom<GPUBindGroupLayout>>
https://gpuweb.github.io/gpuweb/#GPUDevice-createBindGroupLayout
source§fn CreatePipelineLayout(
&self,
descriptor: &GPUPipelineLayoutDescriptor
) -> Root<Dom<GPUPipelineLayout>>
fn CreatePipelineLayout(
&self,
descriptor: &GPUPipelineLayoutDescriptor
) -> Root<Dom<GPUPipelineLayout>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createpipelinelayout
source§fn CreateBindGroup(
&self,
descriptor: &GPUBindGroupDescriptor
) -> Root<Dom<GPUBindGroup>>
fn CreateBindGroup(
&self,
descriptor: &GPUBindGroupDescriptor
) -> Root<Dom<GPUBindGroup>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createbindgroup
source§fn CreateShaderModule(
&self,
descriptor: RootedTraceableBox<GPUShaderModuleDescriptor>
) -> Root<Dom<GPUShaderModule>>
fn CreateShaderModule(
&self,
descriptor: RootedTraceableBox<GPUShaderModuleDescriptor>
) -> Root<Dom<GPUShaderModule>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createshadermodule
source§fn CreateComputePipeline(
&self,
descriptor: &GPUComputePipelineDescriptor
) -> Root<Dom<GPUComputePipeline>>
fn CreateComputePipeline(
&self,
descriptor: &GPUComputePipelineDescriptor
) -> Root<Dom<GPUComputePipeline>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createcomputepipeline
source§fn CreateCommandEncoder(
&self,
descriptor: &GPUCommandEncoderDescriptor
) -> Root<Dom<GPUCommandEncoder>>
fn CreateCommandEncoder(
&self,
descriptor: &GPUCommandEncoderDescriptor
) -> Root<Dom<GPUCommandEncoder>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createcommandencoder
source§fn CreateTexture(
&self,
descriptor: &GPUTextureDescriptor
) -> Root<Dom<GPUTexture>>
fn CreateTexture(
&self,
descriptor: &GPUTextureDescriptor
) -> Root<Dom<GPUTexture>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createtexture
source§fn CreateSampler(
&self,
descriptor: &GPUSamplerDescriptor
) -> Root<Dom<GPUSampler>>
fn CreateSampler(
&self,
descriptor: &GPUSamplerDescriptor
) -> Root<Dom<GPUSampler>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createsampler
source§fn CreateRenderPipeline(
&self,
descriptor: &GPURenderPipelineDescriptor
) -> Root<Dom<GPURenderPipeline>>
fn CreateRenderPipeline(
&self,
descriptor: &GPURenderPipelineDescriptor
) -> Root<Dom<GPURenderPipeline>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createrenderpipeline
source§fn CreateRenderBundleEncoder(
&self,
descriptor: &GPURenderBundleEncoderDescriptor
) -> Root<Dom<GPURenderBundleEncoder>>
fn CreateRenderBundleEncoder(
&self,
descriptor: &GPURenderBundleEncoderDescriptor
) -> Root<Dom<GPURenderBundleEncoder>>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createrenderbundleencoder
source§fn PushErrorScope(&self, filter: GPUErrorFilter)
fn PushErrorScope(&self, filter: GPUErrorFilter)
https://gpuweb.github.io/gpuweb/#dom-gpudevice-pusherrorscope
source§fn PopErrorScope(&self, comp: InRealm<'_>) -> Rc<Promise>
fn PopErrorScope(&self, comp: InRealm<'_>) -> Rc<Promise>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-poperrorscope
source§fn CreateComputePipelineAsync(
&self,
_descriptor: &GPUComputePipelineDescriptor
) -> Rc<Promise>
fn CreateComputePipelineAsync(
&self,
_descriptor: &GPUComputePipelineDescriptor
) -> Rc<Promise>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createcomputepipelineasync
source§fn CreateRenderPipelineAsync(
&self,
_descriptor: &GPURenderPipelineDescriptor
) -> Rc<Promise>
fn CreateRenderPipelineAsync(
&self,
_descriptor: &GPURenderPipelineDescriptor
) -> Rc<Promise>
https://gpuweb.github.io/gpuweb/#dom-gpudevice-createrenderpipelineasync
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