simvx.graphics.gpu.context

GPU context: bundles core Vulkan handles used throughout the renderer.

Module Contents

Classes

GPUContext

Immutable bag of GPU handles shared across all renderer passes.

Data

API

simvx.graphics.gpu.context.__all__

[‘GPUContext’]

class simvx.graphics.gpu.context.GPUContext(device: Any, physical_device: Any, graphics_queue: simvx.graphics.gpu.queue.SubmitQueue, present_queue: simvx.graphics.gpu.queue.SubmitQueue | None, graphics_qf: int, cmd_ctx: simvx.graphics.gpu.commands.CommandContext, compute_queue: simvx.graphics.gpu.queue.SubmitQueue | None = None, transfer_queue: simvx.graphics.gpu.queue.SubmitQueue | None = None, compute_qf: int | None = None, transfer_qf: int | None = None, multi_gpu: bool = False, device_count: int = 1)

Immutable bag of GPU handles shared across all renderer passes.

Created once during Vulkan init and stored on Engine as engine.ctx. Renderer passes should accept or store this rather than reaching into engine internals.

The four queues are :class:~simvx.graphics.gpu.queue.SubmitQueue wrappers, not raw VkQueue handles: submitting through one takes the lock that externally synchronises it, which is what makes a tick-time upload safe against the pipelined render thread’s frame submit. The raw handle is reachable as queue.handle for the structures that need one.

Initialization

__slots__

(‘device’, ‘physical_device’, ‘graphics_queue’, ‘present_queue’, ‘graphics_qf’, ‘cmd_ctx’, ‘compute_…

property command_pool: Any

Shorthand for cmd_ctx.pool.

property async_compute: bool

True when a dedicated compute queue exists (multi-queue GPU).

The single capability gate every consumer reads: True selects the async-compute scheduler path (compute passes -> compute queue, graphics submit waits on a semaphore); False is the single-queue fallback, which records every pass into the primary graphics command buffer.

property concurrent_compute_families: list[int] | None

Distinct [graphics_qf, compute_qf] for CONCURRENT buffers, or None when async-compute is off.

Pass this to :func:~simvx.graphics.gpu.memory.create_buffer’s concurrent_families for any control buffer (indirect / visibility / light-grid / particle) that crosses the graphics<->compute boundary. None keeps those buffers EXCLUSIVE (unchanged single-queue path).