Skip to main content

Module directx

Module directx 

Source
Expand description

The same for the DirectX and Vulkan backends: their repr(C) uniform / probe structs + GPU-timing slot arithmetic (mirrored in the HLSL / GLSL shaders). Backend-specific but device-free (plain repr(C), no windows/ash types), so they compile unconditionally and their layout tests count toward coverage. The DirectX / Vulkan backends (concinnity-device) re-export them under their own directx / vulkan.

Modules§

pass_timing
Per-pass GPU timing on D3D12 via TIMESTAMP queries. The whole-frame timer lives in slots [0, 1] of each frame’s block; one pair per PassId follows (start at slot 2 + 2i, end at slot 3 + 2i). The shared query heap is sized for FRAMES such blocks; execute_graph issues an EndQuery before and after each pass’s encode_*, and the resolve at the end of the command list copies the whole block into the persistently-mapped readback buffer. The CPU reads the previous frame’s block at the top of draw_frame (after the matching fence wait gates the GPU writes) and publishes the per-pass microseconds into RenderStats.pass_times_us.
uniforms
repr(C) uniform / root-constant structs only the DirectX frame encoders bind (cbuffer / root-constant layouts). Each is mirrored field-for-field in an .hlsl shader under directx/shaders/.