simvx.graphics.renderer.render_context

RenderContext — setup-time GPU facade.

Passes receive this in setup() instead of raw engine references. Consolidates GPU resource creation entry points and exposes concrete Vulkan handles as plain attributes. Does NOT wrap per-frame command recording — passes call vk.* directly inside record().

For a future Metal backend, a MetalRenderContext subclass would hold Metal equivalents in the same-named attributes.

Module Contents

Classes

RenderContext

Setup-time GPU facade. Created once by ForwardRenderer, passed to pass.setup().

Data

API

simvx.graphics.renderer.render_context.__all__

[‘RenderContext’]

class simvx.graphics.renderer.render_context.RenderContext(engine: Any, resources: simvx.graphics.renderer.resource_registry.ResourceRegistry)[source]

Setup-time GPU facade. Created once by ForwardRenderer, passed to pass.setup().

Initialization

__slots__

(‘device’, ‘physical_device’, ‘graphics_queue’, ‘command_pool’, ‘texture_descriptor_layout’, ‘textur…

create_buffer(size: int, usage: int, properties: int) tuple[Any, Any][source]

Create a Vulkan buffer + memory. Returns (buffer, memory).

create_image(width: int, height: int, fmt: int, usage: int) tuple[Any, Any][source]

Create a Vulkan image + memory. Returns (image, memory).

create_sampler() Any[source]

Create a default linear sampler.

load_shader(filename: str) Any[source]

Compile a shader from the engine’s shader directory and create a module.

upload_image_data(pixels: Any, width: int, height: int, fmt: int) tuple[Any, Any][source]

Upload pixel data to a GPU image. Returns (image, memory).

transition_image_layout(image: Any, old_layout: int, new_layout: int) None[source]

Transition an image between layouts (setup-time only).

upload_numpy(memory: Any, data: Any) None[source]

Upload numpy array data to mapped GPU memory.