mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:10:51 +01:00
[PR #1951] runtime: copy contiguous X micro-runs in TiledSurface2D::tile/detile #1958
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1958
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1951
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:perf/rt-gfx10-tiling-fast-runs📝 Commits (1)
1e88ddbruntime: copy contiguous X micro-runs in TiledSurface2D::tile/detile📊 Changes
2 files changed (+97 additions, -15 deletions)
View changed files
📝
runtime/src/gfx10_tiling.h(+92 -15)📝
runtime/test/gfx10_tiling_test.cpp(+5 -0)📄 Description
Item ID:
RT-GFX10-TILING-FAST-RUNS(claimed in #1608 comment #7168111876).Summary
Accelerates
leonida::gfx10::TiledSurface2D::tile()anddetile()(runtime/src/gfx10_tiling.h) by deriving each tiling pattern's contiguous X micro-run width and hoisting direction/tile-row work out of the innermost loop, preserving bit-exact output and untouched padding bytes:run_elements_,run_bytes_):pattern_: 16 bytes forsw_4kb_s(all element sizes) andsw_64kb_d2/4/8 BPE, 8 bytes forsw_64kb_d1 BPE, and 32 bytes forsw_64kb_d16 BPE.copy_runs<ToTiled, RunBytes>):y_offsets[min(height, tile_height)]once per call instead of recomputing the 12/16-bit Y swizzle on every scanline, and stores compactuint32_trun-granularityx_offsets(at most 64 entries across all 10 patterns).ToTiledandRunBytes(8 / 16 / 32) at compile time so every full micro-run emits a fixed-width inline copy with zero per-element direction branch or runtime-lengthmemcpy, and copies any non-aligned row tail in a single exact-lengthmemcpywithout touching padding in either buffer.runtime/test/gfx10_tiling_test.cpp:tile_width + 1/tile_height + 1dimensions across both modes and all 5 element sizes (90 surfaces × 2 pitches).A/B Benchmark (
-O2, 2 runs, bit-exact FNV-64 hashes on all 7 cases)tiletiledetiledetile4KB_S 1B(1024×1024)4KB_S 4B(1024×1024)64KB_D 1B(1024×1024)64KB_D 4B(1024×1024)64KB_D 8B(1024×1024)64KB_D 16B(512×512)64KB_D 4B(1021×769 odd)Verification
clang++ -std=c++20 -O1 -g -fsanitize=address,undefined -Wall -Wextra -Werror:gfx10_tiling_testPASSclang++ -std=c++20 -O1 -g -fsanitize=thread -Wall -Wextra -Werror:gfx10_tiling_testPASSclang++ -std=c++20 -O2 -Wall -Wextra -Werror:gfx10_tiling_test× 3 runs PASScheck_no_game_data.pyPASS,tests/test_text_write_line_endings.pyPASS (3/3)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.