simvx.graphics._engine_init¶
Vulkan initialisation and swapchain lifecycle helpers for Engine.
Module Contents¶
Functions¶
Initialise Vulkan instance, device, swapchain, render pass, and command buffers. |
|
Create the instance-level handles (instance, debug messenger, surface). |
|
Create everything bound to the logical device (recreated on a rebuild). |
|
Create depth buffer image, memory, and view. |
|
Destroy depth buffer resources. |
|
Create framebuffers for each swapchain image. |
|
Destroy all swapchain framebuffers. |
|
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_surfacemakes the instance-level handles that survive a device-only loss;create_device_objectsmakes 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_surfaceto have run first (readsengine._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
vsyncto also switch present mode in the rebuild: used by- Meth:
Engine.set_vsyncto apply a runtime toggle without relaunch.