WebGPU module

webgpu_canvas_size

procedureextensionexperimentalWasm onlysince 0.28.0Source

Browser only: the size in pixels of the page's canvas. It changes when the page resizes the canvas, so compare it each frame and configure the surface again.

Example↗
width, height := webgpu_canvas_size();

This one is only checked to compile, not run.

webgpu_canvas_size :: () -> (width: s32, height: s32)

Returns

width: s32
height: s32

See also