simvx.graphics.renderer.pass_helpers

Shared GPU resource creation helpers for render passes.

Pure factory functions — no base classes, no lifecycle management. Each function creates a single Vulkan resource using common patterns duplicated across multiple pass files.

Module Contents

Functions

load_shader_modules

Compile and load vertex/fragment shader modules from GLSL source files.

create_linear_sampler

Create a linear-filtering sampler with CLAMP_TO_EDGE addressing.

create_nearest_sampler

Create a nearest-filtering sampler with CLAMP_TO_EDGE addressing.

create_sampler_descriptor_pool

Create a descriptor pool and allocate sets for COMBINED_IMAGE_SAMPLER descriptors.

Data

API

simvx.graphics.renderer.pass_helpers.__all__

[‘load_shader_modules’, ‘create_linear_sampler’, ‘create_nearest_sampler’, ‘create_sampler_descripto…

simvx.graphics.renderer.pass_helpers.load_shader_modules(device: Any, shader_dir: pathlib.Path, vert_name: str, frag_name: str) tuple[Any, Any]

Compile and load vertex/fragment shader modules from GLSL source files.

Runs compile_shader (GLSL -> SPIR-V) then create_shader_module for each stage. Returns (vert_module, frag_module).

simvx.graphics.renderer.pass_helpers.create_linear_sampler(device: Any) Any

Create a linear-filtering sampler with CLAMP_TO_EDGE addressing.

Used by text (MSDF atlas) and 2D overlay passes that need clamped UVs.

simvx.graphics.renderer.pass_helpers.create_nearest_sampler(device: Any) Any

Create a nearest-filtering sampler with CLAMP_TO_EDGE addressing.

Used for pixel-art or integer-format textures where interpolation is unwanted.

simvx.graphics.renderer.pass_helpers.create_sampler_descriptor_pool(device: Any, layout: Any, *, max_sets: int = 1, descriptors_per_set: int = 1) tuple[Any, list[Any]]

Create a descriptor pool and allocate sets for COMBINED_IMAGE_SAMPLER descriptors.

Returns (pool, [descriptor_set, ...]).