Orgnaization & cleanup

This commit is contained in:
Zachary Levy
2026-04-30 16:52:55 -07:00
parent 16989cbb71
commit fd64bc01bf
13 changed files with 269 additions and 258 deletions
+5 -5
View File
@@ -830,9 +830,9 @@ end :: proc(device: ^sdl.GPUDevice, window: ^sdl.Window, clear_color: Color = DF
}
// Pre-scan: if any layer this frame has a backdrop sub-batch, route the entire frame to
// source_texture (Approach B) so the bracket can sample the pre-bracket framebuffer
// without a mid-frame texture copy. Frames without any backdrop hit the existing fast
// path and never touch the backdrop pipeline's working textures.
// source_texture so the bracket can sample the pre-bracket framebuffer without a mid-
// frame texture copy. Frames without any backdrop hit the existing fast path and never
// touch the backdrop pipeline's working textures.
has_backdrop := frame_has_backdrop()
// Upload primitives to GPU (vertices, indices, SDF prims, and backdrop prims share one
@@ -880,8 +880,8 @@ end :: proc(device: ^sdl.GPUDevice, window: ^sdl.Window, clear_color: Color = DF
draw_layer(device, window, cmd_buffer, render_texture, width, height, clear_color_f32, &layer)
}
// Approach B finalization: when we rendered into source_texture, copy it to the swapchain.
// Single CopyGPUTextureToTexture call per frame, only when backdrop content was present.
// When we rendered into source_texture, copy it to the swapchain. Single
// CopyGPUTextureToTexture call per frame, only when backdrop content was present.
if has_backdrop {
copy_pass := sdl.BeginGPUCopyPass(cmd_buffer)
sdl.CopyGPUTextureToTexture(