pub struct WebGpuRendererInit {
pub device: JsValue,
pub queue: JsValue,
pub context: JsValue,
pub canvas: HtmlCanvasElement,
pub format: String,
pub width: u32,
pub height: u32,
pub antialias: bool,
}Expand description
Constructor inputs for WebGpuRenderer. Grouped into one struct so the
constructor stays a single-argument call (the renderer carries enough GPU
handles and canvas parameters that a positional parameter list would be
unwieldy). All fields are public so integration tests can assemble a
renderer around Reflect stand-in objects.
Fields§
§device: JsValueThe WebGPU device (GpuDevice).
queue: JsValueThe device’s command queue (GpuQueue).
context: JsValueThe WebGPU canvas rendering context (GpuCanvasContext).
canvas: HtmlCanvasElementThe HTML canvas element backing the context.
format: StringThe texture format string used by the swap chain (e.g., "bgra8unorm").
width: u32The physical pixel width of the canvas backing store.
height: u32The physical pixel height of the canvas backing store.
antialias: boolWhether MSAA anti-aliasing is enabled for render pipelines.
get_width / get_height / get_antialias are type(copy): a
primitive getter hands back the value, not a reference (§17.8.1).