pub enum GpuReceiverClass {
Device,
Queue,
Context,
Texture,
CommandEncoder,
RenderPass,
ComputePass,
}Expand description
WebGPU receiver-class discriminator for the cached_method cache.
JS class methods live on the prototype, so the same Function instance
is returned for every receiver of a given class — the (class, method)
pair uniquely identifies the cached Function and no receiver identity
is needed. This replaces the previous stack-address keying: per-frame
temporary JsValues (pass encoders, command encoders) reuse stack
slots across frames, so an address-keyed cache could return the wrong
class’s Function when a GPUComputePassEncoder landed on a slot that
previously held a GPURenderPassEncoder (both share setPipeline /
setBindGroup / end), producing a swallowed TypeError and a silently
skipped GPU call.
Variants§
Device
GPUDevice (immortal, renderer-owned).
Queue
GPUQueue (immortal, renderer-owned).
Context
GPUCanvasContext (immortal, renderer-owned).
Texture
GPUTexture (per-call temporary).
CommandEncoder
GPUCommandEncoder (per-frame temporary).
RenderPass
GPURenderPassEncoder (per-pass temporary).
ComputePass
GPUComputePassEncoder (per-pass temporary).