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.
Implementations§
Source§impl WebGpuRendererInit
impl WebGpuRendererInit
pub fn get_device(&self) -> &JsValue
pub fn get_mut_device(&mut self) -> &mut JsValue
pub fn set_device(&mut self, val: JsValue) -> &mut Self
pub fn get_queue(&self) -> &JsValue
pub fn get_mut_queue(&mut self) -> &mut JsValue
pub fn set_queue(&mut self, val: JsValue) -> &mut Self
pub fn get_context(&self) -> &JsValue
pub fn get_mut_context(&mut self) -> &mut JsValue
pub fn set_context(&mut self, val: JsValue) -> &mut Self
pub fn get_canvas(&self) -> &HtmlCanvasElement
pub fn get_mut_canvas(&mut self) -> &mut HtmlCanvasElement
pub fn set_canvas(&mut self, val: HtmlCanvasElement) -> &mut Self
pub fn get_format(&self) -> &String
pub fn get_mut_format(&mut self) -> &mut String
pub fn set_format(&mut self, val: String) -> &mut Self
pub fn get_width(&self) -> &u32
pub fn get_mut_width(&mut self) -> &mut u32
pub fn set_width(&mut self, val: u32) -> &mut Self
pub fn get_height(&self) -> &u32
pub fn get_mut_height(&mut self) -> &mut u32
pub fn set_height(&mut self, val: u32) -> &mut Self
pub fn get_antialias(&self) -> &bool
pub fn get_mut_antialias(&mut self) -> &mut bool
pub fn set_antialias(&mut self, val: bool) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebGpuRendererInit
impl RefUnwindSafe for WebGpuRendererInit
impl Send for WebGpuRendererInit
impl Sync for WebGpuRendererInit
impl Unpin for WebGpuRendererInit
impl UnsafeUnpin for WebGpuRendererInit
impl UnwindSafe for WebGpuRendererInit
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