simvx.graphics.renderer.buffer_manager

BufferManager — owns the forward renderer’s SSBOs and descriptor sets.

Extracted from Renderer so transform/material/light/shadow/joint buffers and the Forward+ tile-culling placeholders live in one place. The descriptor set layout and cubemap placeholder are owned here too so the renderer can swap the IBL cubemap in via write_cubemap_descriptor.

Module Contents

Classes

BufferManager

Owns the renderer’s SSBOs and descriptor sets.

Data

API

simvx.graphics.renderer.buffer_manager.__all__

[‘BufferManager’, ‘SHADOW_DATA_SIZE’]

simvx.graphics.renderer.buffer_manager.log

‘getLogger(…)’

simvx.graphics.renderer.buffer_manager.SHADOW_DATA_SIZE

352

class simvx.graphics.renderer.buffer_manager.BufferManager(engine: Any, max_objects: int, max_materials: int = 1024, max_lights: int = 256, max_joints: int = 256)[source]

Owns the renderer’s SSBOs and descriptor sets.

Main descriptor set (ssbo_set) exposes seven bindings: 0: transforms, 1: materials, 2: lights, 3: shadow, 4: IBL cubemap sampler, 5: tile light indices, 6: tile info.

Joint descriptor set (joint_set) is set 2 binding 0 for skinned meshes.

Initialization

setup() None[source]

Allocate all SSBOs and descriptor sets.

upload_transforms(instances: list) None[source]

Upload all instance transforms + normal matrices + material ids to the SSBO.

set_materials(materials: numpy.ndarray) numpy.ndarray[source]

Upload material array. Returns the (possibly clamped) array stored.

set_lights(lights: numpy.ndarray) None[source]

Upload light array prefixed with the uint32 count (GLSL LightBuffer layout).

set_hdr_flag(enabled: bool) None[source]

Toggle hdr_output (byte offset 216) in the shadow SSBO.

write_shadow_data(shadow_data: numpy.ndarray) None[source]

Upload raw shadow SSBO bytes (used by shadow passes + IBL-only fallback).

write_cubemap_descriptor(view: Any, sampler: Any) None[source]

Bind a cubemap view+sampler to the IBL slot (binding 4).

cleanup() None[source]

Destroy all buffers, descriptor pools/layouts, and placeholder cubemap.