simvx.graphics._engine_init

Vulkan initialisation and swapchain lifecycle helpers for Engine.

Module Contents

Functions

init_vulkan

Initialise Vulkan instance, device, swapchain, render pass, and command buffers.

create_instance_and_surface

Create the instance-level handles (instance, debug messenger, surface).

create_device_objects

Create everything bound to the logical device (recreated on a rebuild).

create_depth_resources

Create depth buffer image, memory, and view.

destroy_depth_resources

Destroy depth buffer resources.

create_framebuffers

Create framebuffers for each swapchain image.

destroy_framebuffers

Destroy all swapchain framebuffers.

recreate_swapchain

Recreate swapchain, depth buffer, and framebuffers after resize.

Data

API

simvx.graphics._engine_init.__all__

[‘init_vulkan’, ‘create_instance_and_surface’, ‘create_device_objects’, ‘create_depth_resources’, ‘d…

simvx.graphics._engine_init.log

‘getLogger(…)’

simvx.graphics._engine_init.init_vulkan(engine: simvx.graphics.engine.Engine, use_triangle: bool = True) None[source]

Initialise Vulkan instance, device, swapchain, render pass, and command buffers.

Thin orchestration over the two reusable halves so the create/destroy seam is symmetric for device-loss recovery: create_instance_and_surface makes the instance-level handles that survive a device-only loss; create_device_objects makes everything bound to the logical device (recreated on a rebuild).

simvx.graphics._engine_init.create_instance_and_surface(engine: simvx.graphics.engine.Engine) None[source]

Create the instance-level handles (instance, debug messenger, surface).

These survive a device-only loss: on recovery we keep the window + surface and rebuild only the device objects.

simvx.graphics._engine_init.create_device_objects(engine: simvx.graphics.engine.Engine, use_triangle: bool = True) None[source]

Create everything bound to the logical device (recreated on a rebuild).

Selects the physical device, creates the logical device, swapchain, render pass, depth + framebuffers, command context, multi-GPU manager, GPU context, async-compute scheduler, frame sync, and timestamp pools. Requires create_instance_and_surface to have run first (reads engine._surface).

simvx.graphics._engine_init.create_depth_resources(engine: simvx.graphics.engine.Engine) None[source]

Create depth buffer image, memory, and view.

simvx.graphics._engine_init.destroy_depth_resources(engine: simvx.graphics.engine.Engine) None[source]

Destroy depth buffer resources.

simvx.graphics._engine_init.create_framebuffers(engine: simvx.graphics.engine.Engine) None[source]

Create framebuffers for each swapchain image.

simvx.graphics._engine_init.destroy_framebuffers(engine: simvx.graphics.engine.Engine) None[source]

Destroy all swapchain framebuffers.

simvx.graphics._engine_init.recreate_swapchain(engine: simvx.graphics.engine.Engine, *, vsync: bool | None = None) None[source]

Recreate swapchain, depth buffer, and framebuffers after resize.

Pass vsync to also switch present mode in the rebuild: used by

Meth:

Engine.set_vsync to apply a runtime toggle without relaunch.