simvx.graphics.gpu.pipeline¶
Graphics pipeline and shader module management.
Module Contents¶
Functions¶
Load a SPIR-V file and create a VkShaderModule. |
|
Create a VkPipeline for triangle rendering. Returns (pipeline, layout). |
|
Create a pipeline for forward rendering with vertex inputs and SSBOs. |
|
Create a pipeline for transparent object rendering. |
|
Create a pipeline for skinned mesh rendering. |
|
Create a pipeline for the pick pass (R32_UINT output, position-only vertex input). |
|
Create a pipeline for line rendering with per-vertex color. |
|
Create a pipeline for solid-color 2D UI rendering. |
|
Create a pipeline for a textured fullscreen quad (no depth test). |
|
Create a pipeline for gizmo overlay rendering (depth test DISABLED). |
Data¶
API¶
- simvx.graphics.gpu.pipeline.__all__¶
[‘create_shader_module’, ‘create_graphics_pipeline’, ‘create_forward_pipeline’, ‘create_transparent_…
- simvx.graphics.gpu.pipeline.log¶
‘getLogger(…)’
- simvx.graphics.gpu.pipeline.create_shader_module(device: Any, spirv_path: pathlib.Path) Any¶
Load a SPIR-V file and create a VkShaderModule.
- simvx.graphics.gpu.pipeline.create_graphics_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int]) tuple[Any, Any]¶
Create a VkPipeline for triangle rendering. Returns (pipeline, layout).
Uses raw cffi allocation to avoid the vulkan wrapper’s GC lifetime issues with nested pointer structs.
- simvx.graphics.gpu.pipeline.create_forward_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int], descriptor_layout: Any, texture_layout: Any | None = None, double_sided: bool = False) tuple[Any, Any]¶
Create a pipeline for forward rendering with vertex inputs and SSBOs.
Vertex format: position (vec3), normal (vec3), uv (vec2) = 32 bytes stride. Push constants: view (mat4) + proj (mat4) = 128 bytes. If texture_layout is provided, set 1 is bound to the texture descriptor layout. If double_sided is True, backface culling is disabled. Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_transparent_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int], descriptor_layout: Any, texture_layout: Any | None = None) tuple[Any, Any]¶
Create a pipeline for transparent object rendering.
Identical to the forward pipeline except:
Alpha blending enabled (srcAlpha, oneMinusSrcAlpha)
Depth write disabled (depth test still enabled)
Backface culling disabled (transparent objects often need both sides)
Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_skinned_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int], descriptor_layout: Any, texture_layout: Any | None = None, joint_layout: Any | None = None) tuple[Any, Any]¶
Create a pipeline for skinned mesh rendering.
Vertex format: position(vec3) + normal(vec3) + uv(vec2) + joints(uvec4) + weights(vec4) = 48 bytes. Descriptor sets: 0=SSBOs, 1=textures, 2=joint matrices SSBO. Push constants: view (mat4) + proj (mat4) = 128 bytes. Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_pick_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int], descriptor_layout: Any) tuple[Any, Any]¶
Create a pipeline for the pick pass (R32_UINT output, position-only vertex input).
Push constants: view (mat4) + proj (mat4) = 128 bytes. Vertex input: position (vec3) only, stride 32 (same buffer as forward, skips normal/uv). Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_line_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int]) tuple[Any, Any]¶
Create a pipeline for line rendering with per-vertex color.
Vertex format: position (vec3) + color (vec4) = 28 bytes stride. Push constants: view (mat4) + proj (mat4) = 128 bytes. No descriptor sets. Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_ui_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int]) tuple[Any, Any]¶
Create a pipeline for solid-color 2D UI rendering.
Vertex format: position (vec2) + uv (vec2) + color (vec4) = 32 bytes stride. Push constants: screen_size (vec2) = 8 bytes. No descriptor sets, no depth test. Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_textured_quad_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int], texture_layout: Any) tuple[Any, Any]¶
Create a pipeline for a textured fullscreen quad (no depth test).
Vertex format: position (vec2) + uv (vec2) = 16 bytes stride. Descriptor set 0: combined image sampler (texture). Returns (pipeline, pipeline_layout).
- simvx.graphics.gpu.pipeline.create_gizmo_pipeline(device: Any, vert_module: Any, frag_module: Any, render_pass: Any, extent: tuple[int, int], *, topology: int = vk.VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST) tuple[Any, Any]¶
Create a pipeline for gizmo overlay rendering (depth test DISABLED).
Same vertex format as line pipeline: position (vec3) + color (vec4) = 28 bytes. Push constants: view (mat4) + proj (mat4) = 128 bytes. Supports both TRIANGLE_LIST and LINE_LIST topology via topology parameter. Returns (pipeline, pipeline_layout).