Skip to content

perf(runtime): deferred disjoint-blit barrier batching in BlitCommandEncoder (P4-2a) - #9

Open
Apdelrahman1911 wants to merge 3 commits into
x86simfrom
perf/p4-2a-blit-batching
Open

Apdelrahman1911 wants to merge 3 commits into
x86simfrom
perf/p4-2a-blit-batching

Conversation

@Apdelrahman1911

Copy link
Copy Markdown

Implements P4-2a from the post-P3 toward-60-FPS audit:

  • Adds deferred BlitBatch inside BlitCommandEncoder (blit.rs) so consecutive disjoint blits (multi-texture proxy writebacks, disjoint atlas quadrant uploads, disjoint buffer copies/fills) share 1 leading vkCmdPipelineBarrier2 (combining all image away layout transitions) and 1 deferred closing barrier (combining all back transitions, which still joins the next pass or segment end via P3-4A/B).
  • Preserves exact hazard & alias safety:
    • Plain buffers tracked by (vk::Buffer, start..end) byte spans; plain textures by (vk::Image, level, layer, aspect, layout) + 3D texel write boxes (deduplicating away/back for disjoint quadrant writes while flushing on WAW overlap, layout/aspect mismatch, or UNDEFINED whole-subresource discard).
    • Heap/in-place/surface/copied-over resources tracked at tracked_id() granularity alongside all_buf_ids / aliased_tex_ids.
    • Flushes before any non-empty managed_backs, overs_owed, aliases, multi-slab/shared/overwrite blit, generate_mipmaps, reset_commands_in_buffer, read_back_range, fence op, or encoder end.
  • Updates the 2 expected barrier-count assertions in tests/blit.rs (every_device_copies_between_buffers_and_textures: (copies, copies) -> (1, 1); every_device_coalesces_back_to_back_blit_barriers Case 1: (4, 1, 5, 4, 4) -> (1, 1, 2, 1, 1)) and adds every_device_batches_disjoint_blits_and_flushes_hazards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant