simvx.graphics.renderer.render_target¶
Offscreen render target with colour + depth attachments.
Module Contents¶
Classes¶
Manages an offscreen render target for render-to-texture. |
Data¶
API¶
- simvx.graphics.renderer.render_target.log¶
‘getLogger(…)’
- simvx.graphics.renderer.render_target.__all__¶
[‘RenderTarget’, ‘GBUFFER_FORMAT’]
- simvx.graphics.renderer.render_target.GBUFFER_FORMAT¶
None
- class simvx.graphics.renderer.render_target.RenderTarget(device: Any, physical_device: Any, width: int, height: int, colour_format: int = vk.VK_FORMAT_R8G8B8A8_UNORM, use_depth: bool = True, samplable_depth: bool = False, *, initial_layout: int = vk.VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, queue: Any = None, command_pool: Any = None, reload_pass: bool = False, gbuffer: bool = False)[source]¶
Manages an offscreen render target for render-to-texture.
The colour image is transitioned to
initial_layoutat construction so it is safe to sample (or bind to a descriptor) before the first render pass writes to it. The default :data:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMALmatches the offscreen render pass’sfinalLayout: the render pass itself usesinitialLayout=UNDEFINEDwithLOAD_OP_CLEAR, so the pre-transition is discarded harmlessly on the first frame.Initialization
- begin_frame_barrier(cmd: Any) None[source]¶
Order this frame’s attachment writes after the previous frame’s accesses.
This target is a single shared instance reused across
FRAMES_IN_FLIGHT, so frame N’s colour/depth clear races frame N-1’s accesses to the same image. The offscreen pass’s incomingEXTERNALdependency (which does chain across submits via submission order) only reaches prior attachment writes at the attachment-output/fragment-test stages; it does not cover two hazards this barrier adds:WAW visibility of frame N-1’s
storeOpwrite (itssrcAccessMaskis 0, and anoldLayout=UNDEFINEDimage barrier would discard), andWAR against frame N-1’s fragment-shader reads of this target (a later pass sampling it, or a TAA-style resolve reading it as history) –
FRAGMENT_SHADERis absent from the render pass’s source scope entirely, so frame N’s clear could overtake those reads.
A global memory barrier carries both with no layout change and near-zero cost (usually a no-op execution dependency); it is the render-graph alternative to per-frame target duplication. Record it immediately before
vkCmdBeginRenderPass.