pygfx.renderers.wgpu.Shared

class pygfx.renderers.wgpu.Shared(*, canvas=None)

Bases: Trackable

An object to store global data to share between multiple wgpu renderers. Each renderer updates the data and then passes this down to the pipeline containers.

The renderer instantiates and stores the singleton shared object.

pre_render_hook()

Called by the renderer on the beginning of a draw.

property adapter

The shared WGPU adapter object.

property device

The shared WGPU device object.

property uniform_buffer

The shared uniform buffer in which the renderer puts information about the canvas and camera.

property glyph_atlas_texture

The shared glyph atlas (as a texture view and sampler) for objects that want to render text.

property glyph_atlas_info_buffer

A buffer containing per-glyph metadata (rects and more).