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

simvx.graphics.renderer.buffer_manager.MAX_PROBES

8

simvx.graphics.renderer.buffer_manager.PROBE_BUFFER_SIZE

None

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 thirteen bindings: 0: transforms, 1: materials, 2: lights, 3: shadow, 4: IBL cubemap sampler, 5: tile light indices, 6: tile info, 7/8/9: IBL irradiance cube / prefilter cube / BRDF 2D LUT, 10/11: reflection-probe irradiance / prefilter cube arrays, 12: reflection-probe box SSBO.

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

Initialization

setup() None[source]

Allocate all SSBOs and descriptor sets.

write_probe_descriptors(irradiance_array_view: Any, prefilter_array_view: Any, sampler: Any) None[source]

Bind the ReflectionProbePass’s cubemap arrays to the forward set (bindings 10/11).

write_probe_buffer(data: numpy.ndarray) None[source]

Upload the probe box SSBO bytes (count header + Probe array, binding 12).

write_ibl_descriptors(irradiance_view: Any, prefilter_view: Any, brdf_view: Any, sampler: Any) None[source]

Bind an IBLPass’s precomputed maps to the forward set (bindings 7/8/9).

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.