simvx.graphics.gpu.context¶
GPU context: bundles core Vulkan handles used throughout the renderer.
Module Contents¶
Classes¶
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.SubmitQueuewrappers, not rawVkQueuehandles: 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 asqueue.handlefor 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:
Trueselects the async-compute scheduler path (compute passes -> compute queue, graphics submit waits on a semaphore);Falseis 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, orNonewhen async-compute is off.Pass this to :func:
~simvx.graphics.gpu.memory.create_buffer’sconcurrent_familiesfor any control buffer (indirect / visibility / light-grid / particle) that crosses the graphics<->compute boundary.Nonekeeps those buffers EXCLUSIVE (unchanged single-queue path).