fix(vk): split non-4-aligned multi-layer BC mip-tail copies on AMD Windows and restore 8-layer runs #2228

Open
madebyjordan wants to merge 2 commits from madebyjordan/Longshot:fix/bc-copy-per-layer into main
Member

Summary

Finds and fixes the root cause of Hyrule Field's dark terrain grid lines on AMD's Windows driver (#2006, #2107, #2110), and restores 8-layer ASTC-to-BC small-scratch batching (bc_small_runs=1) and RX_VK_BC_LEVELS grouped mip re-encoding (#1987) on AMD's Windows driver (which #2148 had to disable until the cause was found).

Note: stacked on feat/gpu-arch (PR #2227).

Root cause (reproduced in standalone Vulkan probes on RX 6700 XT, AMD Windows driver 26.10.1 / 0x800161):
On AMD's proprietary Windows driver (diagnosed on RDNA 2), a single vkCmdCopyBufferToImage region with layerCount > 1 into a block-compressed (BC3 or BC7) mip-tail level whose extent is not a multiple of 4 ((w & 3) || (h & 3)) truncates the copied block extent to floor(w/4) x floor(h/4) instead of ceil(w/4) x ceil(h/4), leaving the rightmost column and bottommost row of blocks all 0x00 (pure black) on every layer.

  • On the 1365 x 1365 x 90 terrain material arrays, mip 8 is 5 x 5 (2 x 2 blocks = 64 B/layer): only block (0,0) (16 B) is copied while blocks (1,0), (0,1), (1,1) (48 B — right/bottom border) stay zeroed on all 90 layers, creating the dark tile seams on distant hills while close-up mips 0..7 remain clean.
  • Reproduces at layerCount = 2..8 for both BC3 and BC7, both with bufferRowLength = 0 and with #2015's explicit bufferRowLength = blocks_x * 4, bufferImageHeight = blocks_y * 4, and across other non-4-aligned mip tails (6x6, 5x5, 9x9).
  • Splitting only those non-4-aligned multi-layer copies into n single-layer VkBufferImageCopy regions (layerCount = 1, explicit bufferOffset = (i0 + j) * layer_bytes) inside the same vkCmdCopyBufferToImage call produces a 100% bit-for-bit exact match against n = 1 across all 90 layers and all mips 1..10, with zero measurable overhead (1731 ms vs 1746 ms).

What this changes:

  • gpu/vk/device_policy.h & gpu/vk/switches.def:
    • Adds DevicePolicy::bc_copy_per_layer (RX_VK_BC_COPY_PER_LAYER), defaulted on across AMD's Windows driver (f.amd_win()) and off everywhere else, logged in vk: policy: driver fixes with (seen on 0x800161). Keeping bc_copy_per_layer symmetric with bc_small_runs avoids exposing untested AMD Windows generations (RDNA 1, RDNA 3, GCN) to #2006 at zero measurable cost.
    • Restores DevicePolicy::bc_small_runs = f.radv() || f.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY || f.amd_win(); so AMD's Windows driver regains 8-layer small-scratch runs and #1987 mip-level grouping.
  • gpu/vk/vk_texture.cpp (bc_encode_into): when dev.policy.bc_copy_per_layer && n > 1 && ((w & 3) || (h & 3)), emits n single-layer VkBufferImageCopy regions (chunked by 8, so 1 vkCmdCopyBufferToImage call for normal runs up to kBcLayers = 8) with explicit bufferOffset. Every other driver and all 4-aligned or single-layer mips remain on the untouched single-region path.
  • Updates tests/test_bc_copy_layer_pitch.py (tests both bc_copy_per_layer=0 and bc_copy_per_layer=1, including non-zero (dx, dy) sub-region copies and n > 8 chunking; fails on main), tests/test_device_policy.py, tests/test_bc_small_scratch.py, and tests/test_astc_upload_chunking.py.

To see the bug: Windows, AMD RDNA 2 (RX 6700 XT) with RX_VK_BC_SMALL_LAYERS=8 on main (or RX_VK_BC_COPY_PER_LAYER=0 here), load castle-gate (HyruleField_Child) and look across the distant sunlit hills left and right of the drawbridge: dark grid seams appear across the terrain. With this PR's defaults (bc_small_runs=1, bc_copy_per_layer=1), the terrain is clean and 8-layer batching stays active.

Read first: gpu/vk/device_policy.h (bc_copy_per_layer, bc_small_runs), then gpu/vk/vk_texture.cpp (bc_encode_into).

See #2006, See #2015, See #2107, See #2110, See #2148

Testing

Tested: Windows 11, AMD Radeon RX 6700 XT (1002:73df), AMD driver 26.10.1 (0x800161), headless in-game on castle-gate (HyruleField_Child) and HyruleField_Adult (noon):

  • Default (bc_small_runs=1, bc_copy_per_layer=1, vk: the small BC3 scratch: 1024 x 1024, 8 layers): Hyrule Field distant terrain is completely clean (zero grid lines), matching 1-layer runs visually while restoring 8-layer batching.
  • Override RX_VK_BC_COPY_PER_LAYER=0 (bc_small_runs=1, bc_copy_per_layer=0*): dark square grid seams immediately reproduce across the distant hills on the exact same castle-gate view (screenshots attached in comment).
  • Earlier Beanstalk run on a724a83 passed on windows+amd-proprietary+gpu-rx-9xxx (RX 9060 XT, 2 reports), linux+radv (RX 9070 / XT, 2 reports), and windows+nvidia-proprietary (RTX 4070 / 3080 Ti, 2 reports).
  • On 3bab53e06: dev.py vk builds longshot_vk.dll cleanly on Windows (llvm-mingw), and game-free checks pass on both clang++ and g++: test_bc_copy_layer_pitch.py, test_bc_small_scratch.py, test_device_policy.py, test_gpu_arch.py, test_astc_upload_chunking.py, and test_doc_anchors.py (test_switch_table.py fails only on the pre-existing main sort order of RX_VK_GRASS_DISTANCE / RX_VK_SIM_TURF_ADAPTIVE, tracked in #2197).

Still to test:

  • Re-confirm on 3bab53e06 via Beanstalk on Windows AMD RDNA 3/4 (RX 7000 / RX 9000, now with bc_copy_per_layer=1 alongside bc_small_runs=1), plus Linux build/RADV and Windows NVIDIA (bc_copy_per_layer=0, unchanged).

Measurements

Verdict: faster and clean: restores 8-layer ASTC-to-BC small-scratch batching on AMD Windows, cutting the two 1365 x 1365 x 90 terrain array ASTC-on-GPU upload times at Hyrule Field entry by -375 ms (-17.8%) (2106 ms -> 1731 ms median, non-overlapping runs) and the entry frame upload spike by -400 ms (2229 ms -> 1829 ms), with zero measurable overhead from bc_copy_per_layer=1 (1731 ms vs 1746 ms with RX_VK_BC_COPY_PER_LAYER=0) and zero grid lines on Hyrule Field. RX_VK_BC_COPY_PER_LAYER ships on by default on f.amd_win() (off elsewhere); RX_VK_BC_SMALL_LAYERS ships at 8 on f.amd_win() alongside RADV and NVIDIA. (Widening bc_copy_per_layer from f.amd_win() && f.rdna2() to f.amd_win() in 3bab53e06 leaves RX 6700 XT behavior and code path bit-identical, so these numbers still hold.)

Baseline: a724a837 with RX_VK_BC_SMALL_LAYERS=1 (matches main @ a2dc5385, where #2148 sets bc_small_runs=0 and skips creating the small BC3 scratch on AMD Windows).
Setup: Windows 11, AMD Ryzen 5 5600X, AMD Radeon RX 6700 XT (1002:73df), AMD Windows driver 26.10.1 (0x800161); headless castle-gate (HyruleField_Child), 1920x1080, AF 4x, V-Sync off, FG off; two interleaved pairs (A1, B1, A2, B2) plus one RX_VK_BC_COPY_PER_LAYER=0 check, measured from vk: a frame's uploads took ... on the 1365x1365 x90 terrain arrays.

Before (RX_VK_BC_SMALL_LAYERS=1): this PR @ a724a837 After: this PR @ a724a837 After, RX_VK_BC_COPY_PER_LAYER=0: this PR @ a724a837 Δ (Before → After)
1365x1365 x90 ASTC-on-GPU upload (run 1 / run 2) 2076 ms / 2136 ms 1674 ms / 1787 ms 1746 ms -375 ms median (-17.8%)
Hyrule Field entry upload frame spike (run 1 / run 2) 2245 ms / 2213 ms 1736 ms / 1922 ms 1962 ms -400 ms median (-17.9%)
Small BC3 scratch (1024x1024 x8) not made (1 layer/run) made (8 layers) made (8 layers) restored
Hyrule Field distant terrain clean clean dark grid seams clean at 8 layers

Log lines:

# Before (RX_VK_BC_SMALL_LAYERS=1, matches main @ a2dc5385):
[hos host] vk: a frame's uploads took 2245 ms: ASTC on the GPU 4 (113.0 MB, 2076 ms); on the CPU 102 (52.4 MB, 170 ms); [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 1238 ms] [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 837 ms]
[hos host] vk: a frame's uploads took 2213 ms: ASTC on the GPU 2 (112.9 MB, 2136 ms); on the CPU 102 (52.4 MB, 77 ms); [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 1199 ms] [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 937 ms]

# After (default: bc_small_runs=1, bc_copy_per_layer=1):
[hos MainThread] vk: policy: facts 1002:73df (arch amd_rdna2), driver id 1, version 0x800161 (26.10.1 (AMD proprietary shader compiler)), type 2, Windows
[hos MainThread] vk: policy: driver fixes on driver version 0x800161: ... bc_copy_per_layer=1(seen on 0x800161) ...
[hos MainThread] vk: policy: can and measured: ... bc_small_runs=1
[hos host] vk: the small BC3 scratch: 1024 x 1024, 8 layers
[hos host] vk: a frame's uploads took 1736 ms: ASTC on the GPU 2 (112.9 MB, 1674 ms); on the CPU 102 (52.4 MB, 62 ms); [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 905 ms] [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 769 ms]
[hos host] vk: a frame's uploads took 1922 ms: ASTC on the GPU 2 (112.9 MB, 1787 ms); on the CPU 102 (52.4 MB, 136 ms); [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 956 ms] [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 831 ms]

# After, RX_VK_BC_COPY_PER_LAYER=0 (reproduces dark grid lines):
[hos MainThread] vk: policy: driver fixes on driver version 0x800161: ... bc_copy_per_layer=0* ...
[hos host] vk: the small BC3 scratch: 1024 x 1024, 8 layers
[hos host] vk: a frame's uploads took 1962 ms: ASTC on the GPU 2 (112.9 MB, 1746 ms); on the CPU 102 (52.4 MB, 216 ms); [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 875 ms] [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 871 ms]

Risks

  • Enabling the 1024x1024 8-layer small BC3 scratch on AMD Windows uses 36 MB VRAM (only when not low_vram_texture_mips() and in VRAM), the same as RADV and NVIDIA.
  • Widening bc_copy_per_layer to all f.amd_win() splits non-4-aligned multi-layer BC copies on RDNA 3/4 Windows too; single-layer VkBufferImageCopy regions are strictly simpler than multi-layer compressed copies and measured zero overhead on RX 6700 XT, and players can override either way via RX_VK_BC_COPY_PER_LAYER=0/1 or RX_VK_BC_SMALL_LAYERS=1.
  • Nothing changes in saves, longshot_options.ini, or shader/pipeline caches; reverting restores #2148's 1-layer fallback.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Finds and fixes the root cause of Hyrule Field's dark terrain grid lines on AMD's Windows driver (#2006, #2107, #2110), and restores 8-layer ASTC-to-BC small-scratch batching (`bc_small_runs=1`) and `RX_VK_BC_LEVELS` grouped mip re-encoding (#1987) on AMD's Windows driver (which #2148 had to disable until the cause was found). > Note: stacked on `feat/gpu-arch` (PR #2227). **Root cause (reproduced in standalone Vulkan probes on RX 6700 XT, AMD Windows driver `26.10.1` / `0x800161`):** On AMD's proprietary Windows driver (diagnosed on RDNA 2), a single `vkCmdCopyBufferToImage` region with `layerCount > 1` into a block-compressed (`BC3` or `BC7`) mip-tail level whose extent is not a multiple of 4 (`(w & 3) || (h & 3)`) truncates the copied block extent to `floor(w/4) x floor(h/4)` instead of `ceil(w/4) x ceil(h/4)`, leaving the rightmost column and bottommost row of blocks all `0x00` (pure black) on every layer. - On the `1365 x 1365 x 90` terrain material arrays, mip 8 is `5 x 5` (`2 x 2` blocks = 64 B/layer): only block `(0,0)` (16 B) is copied while blocks `(1,0)`, `(0,1)`, `(1,1)` (48 B — right/bottom border) stay zeroed on all 90 layers, creating the dark tile seams on distant hills while close-up mips `0..7` remain clean. - Reproduces at `layerCount = 2..8` for both `BC3` and `BC7`, both with `bufferRowLength = 0` and with #2015's explicit `bufferRowLength = blocks_x * 4, bufferImageHeight = blocks_y * 4`, and across other non-4-aligned mip tails (`6x6`, `5x5`, `9x9`). - Splitting only those non-4-aligned multi-layer copies into `n` single-layer `VkBufferImageCopy` regions (`layerCount = 1`, explicit `bufferOffset = (i0 + j) * layer_bytes`) inside the same `vkCmdCopyBufferToImage` call produces a 100% bit-for-bit exact match against `n = 1` across all 90 layers and all mips `1..10`, with zero measurable overhead (`1731 ms` vs `1746 ms`). **What this changes:** - `gpu/vk/device_policy.h` & `gpu/vk/switches.def`: - Adds `DevicePolicy::bc_copy_per_layer` (`RX_VK_BC_COPY_PER_LAYER`), defaulted **on across AMD's Windows driver (`f.amd_win()`)** and off everywhere else, logged in `vk: policy: driver fixes` with `(seen on 0x800161)`. Keeping `bc_copy_per_layer` symmetric with `bc_small_runs` avoids exposing untested AMD Windows generations (RDNA 1, RDNA 3, GCN) to #2006 at zero measurable cost. - Restores `DevicePolicy::bc_small_runs = f.radv() || f.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY || f.amd_win();` so AMD's Windows driver regains 8-layer small-scratch runs and #1987 mip-level grouping. - `gpu/vk/vk_texture.cpp` (`bc_encode_into`): when `dev.policy.bc_copy_per_layer && n > 1 && ((w & 3) || (h & 3))`, emits `n` single-layer `VkBufferImageCopy` regions (chunked by 8, so 1 `vkCmdCopyBufferToImage` call for normal runs up to `kBcLayers = 8`) with explicit `bufferOffset`. Every other driver and all 4-aligned or single-layer mips remain on the untouched single-region path. - Updates `tests/test_bc_copy_layer_pitch.py` (tests both `bc_copy_per_layer=0` and `bc_copy_per_layer=1`, including non-zero `(dx, dy)` sub-region copies and `n > 8` chunking; fails on `main`), `tests/test_device_policy.py`, `tests/test_bc_small_scratch.py`, and `tests/test_astc_upload_chunking.py`. To see the bug: Windows, AMD RDNA 2 (RX 6700 XT) with `RX_VK_BC_SMALL_LAYERS=8` on `main` (or `RX_VK_BC_COPY_PER_LAYER=0` here), load `castle-gate` (`HyruleField_Child`) and look across the distant sunlit hills left and right of the drawbridge: dark grid seams appear across the terrain. With this PR's defaults (`bc_small_runs=1`, `bc_copy_per_layer=1`), the terrain is clean and 8-layer batching stays active. Read first: `gpu/vk/device_policy.h` (`bc_copy_per_layer`, `bc_small_runs`), then `gpu/vk/vk_texture.cpp` (`bc_encode_into`). See #2006, See #2015, See #2107, See #2110, See #2148 ## Testing **Tested:** Windows 11, AMD Radeon RX 6700 XT (`1002:73df`), AMD driver `26.10.1` (`0x800161`), headless in-game on `castle-gate` (`HyruleField_Child`) and `HyruleField_Adult` (noon): - Default (`bc_small_runs=1`, `bc_copy_per_layer=1`, `vk: the small BC3 scratch: 1024 x 1024, 8 layers`): Hyrule Field distant terrain is completely clean (zero grid lines), matching 1-layer runs visually while restoring 8-layer batching. - Override `RX_VK_BC_COPY_PER_LAYER=0` (`bc_small_runs=1`, `bc_copy_per_layer=0*`): dark square grid seams immediately reproduce across the distant hills on the exact same `castle-gate` view (screenshots attached in comment). - Earlier Beanstalk run on `a724a83` passed on `windows+amd-proprietary+gpu-rx-9xxx` (RX 9060 XT, 2 reports), `linux+radv` (RX 9070 / XT, 2 reports), and `windows+nvidia-proprietary` (RTX 4070 / 3080 Ti, 2 reports). - On `3bab53e06`: `dev.py vk` builds `longshot_vk.dll` cleanly on Windows (`llvm-mingw`), and game-free checks pass on both `clang++` and `g++`: `test_bc_copy_layer_pitch.py`, `test_bc_small_scratch.py`, `test_device_policy.py`, `test_gpu_arch.py`, `test_astc_upload_chunking.py`, and `test_doc_anchors.py` (`test_switch_table.py` fails only on the pre-existing `main` sort order of `RX_VK_GRASS_DISTANCE` / `RX_VK_SIM_TURF_ADAPTIVE`, tracked in #2197). **Still to test:** - Re-confirm on `3bab53e06` via Beanstalk on Windows AMD RDNA 3/4 (RX 7000 / RX 9000, now with `bc_copy_per_layer=1` alongside `bc_small_runs=1`), plus Linux build/RADV and Windows NVIDIA (`bc_copy_per_layer=0`, unchanged). ## Measurements **Verdict:** faster and clean: restores 8-layer ASTC-to-BC small-scratch batching on AMD Windows, cutting the two `1365 x 1365 x 90` terrain array ASTC-on-GPU upload times at Hyrule Field entry by **-375 ms (-17.8%)** (`2106 ms` -> `1731 ms` median, non-overlapping runs) and the entry frame upload spike by **-400 ms** (`2229 ms` -> `1829 ms`), with zero measurable overhead from `bc_copy_per_layer=1` (`1731 ms` vs `1746 ms` with `RX_VK_BC_COPY_PER_LAYER=0`) and zero grid lines on Hyrule Field. `RX_VK_BC_COPY_PER_LAYER` ships on by default on `f.amd_win()` (off elsewhere); `RX_VK_BC_SMALL_LAYERS` ships at `8` on `f.amd_win()` alongside RADV and NVIDIA. (Widening `bc_copy_per_layer` from `f.amd_win() && f.rdna2()` to `f.amd_win()` in `3bab53e06` leaves RX 6700 XT behavior and code path bit-identical, so these numbers still hold.) Baseline: `a724a837` with `RX_VK_BC_SMALL_LAYERS=1` (matches `main @ a2dc5385`, where #2148 sets `bc_small_runs=0` and skips creating the small BC3 scratch on AMD Windows). Setup: Windows 11, AMD Ryzen 5 5600X, AMD Radeon RX 6700 XT (`1002:73df`), AMD Windows driver `26.10.1` (`0x800161`); headless `castle-gate` (`HyruleField_Child`), `1920x1080`, AF 4x, V-Sync off, FG off; two interleaved pairs (A1, B1, A2, B2) plus one `RX_VK_BC_COPY_PER_LAYER=0` check, measured from `vk: a frame's uploads took ...` on the `1365x1365 x90` terrain arrays. | | Before (RX_VK_BC_SMALL_LAYERS=1): this PR @ a724a837 | After: this PR @ a724a837 | After, RX_VK_BC_COPY_PER_LAYER=0: this PR @ a724a837 | Δ (Before → After) | |---|---|---|---|---| | `1365x1365 x90` ASTC-on-GPU upload (run 1 / run 2) | 2076 ms / 2136 ms | 1674 ms / 1787 ms | 1746 ms | -375 ms median (-17.8%) | | Hyrule Field entry upload frame spike (run 1 / run 2) | 2245 ms / 2213 ms | 1736 ms / 1922 ms | 1962 ms | -400 ms median (-17.9%) | | Small BC3 scratch (`1024x1024 x8`) | not made (1 layer/run) | made (`8 layers`) | made (`8 layers`) | restored | | Hyrule Field distant terrain | clean | clean | dark grid seams | clean at 8 layers | Log lines: ```text # Before (RX_VK_BC_SMALL_LAYERS=1, matches main @ a2dc5385): [hos host] vk: a frame's uploads took 2245 ms: ASTC on the GPU 4 (113.0 MB, 2076 ms); on the CPU 102 (52.4 MB, 170 ms); [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 1238 ms] [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 837 ms] [hos host] vk: a frame's uploads took 2213 ms: ASTC on the GPU 2 (112.9 MB, 2136 ms); on the CPU 102 (52.4 MB, 77 ms); [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 1199 ms] [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 937 ms] # After (default: bc_small_runs=1, bc_copy_per_layer=1): [hos MainThread] vk: policy: facts 1002:73df (arch amd_rdna2), driver id 1, version 0x800161 (26.10.1 (AMD proprietary shader compiler)), type 2, Windows [hos MainThread] vk: policy: driver fixes on driver version 0x800161: ... bc_copy_per_layer=1(seen on 0x800161) ... [hos MainThread] vk: policy: can and measured: ... bc_small_runs=1 [hos host] vk: the small BC3 scratch: 1024 x 1024, 8 layers [hos host] vk: a frame's uploads took 1736 ms: ASTC on the GPU 2 (112.9 MB, 1674 ms); on the CPU 102 (52.4 MB, 62 ms); [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 905 ms] [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 769 ms] [hos host] vk: a frame's uploads took 1922 ms: ASTC on the GPU 2 (112.9 MB, 1787 ms); on the CPU 102 (52.4 MB, 136 ms); [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 956 ms] [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 831 ms] # After, RX_VK_BC_COPY_PER_LAYER=0 (reproduces dark grid lines): [hos MainThread] vk: policy: driver fixes on driver version 0x800161: ... bc_copy_per_layer=0* ... [hos host] vk: the small BC3 scratch: 1024 x 1024, 8 layers [hos host] vk: a frame's uploads took 1962 ms: ASTC on the GPU 2 (112.9 MB, 1746 ms); on the CPU 102 (52.4 MB, 216 ms); [1365x1365 x90 NVN 0x8e ASTC on the GPU 56.5 MB 875 ms] [1365x1365 x90 NVN 0x80 ASTC on the GPU 56.5 MB 871 ms] ``` ## Risks - Enabling the 1024x1024 8-layer small BC3 scratch on AMD Windows uses 36 MB VRAM (only when not `low_vram_texture_mips()` and in VRAM), the same as RADV and NVIDIA. - Widening `bc_copy_per_layer` to all `f.amd_win()` splits non-4-aligned multi-layer BC copies on RDNA 3/4 Windows too; single-layer `VkBufferImageCopy` regions are strictly simpler than multi-layer compressed copies and measured zero overhead on RX 6700 XT, and players can override either way via `RX_VK_BC_COPY_PER_LAYER=0/1` or `RX_VK_BC_SMALL_LAYERS=1`. - Nothing changes in saves, `longshot_options.ini`, or shader/pipeline caches; reverting restores #2148's 1-layer fallback. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
feat(vk): add GPU architecture classifier (gpu_arch.h) and expose DeviceFacts::arch
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Successful in 15s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
Third-party parts / As their notes say (pull_request) Successful in 22s
CI / Website build and checks (pull_request) Failing after 55s
e8915426f3
Centralize GPU architecture classification for AMD (GCN, Vega, RDNA 1-4),
Intel (Gen12, Alchemist, Meteor/Arrow Lake, Lunar Lake, Battlemage, Panther
Lake) and NVIDIA (Pascal-Blackwell) in gpu/vk/gpu_arch.h, wired into
DeviceFacts::arch() / arch_name() and logged on the vk: policy: facts line.

Moves is_rdna3 and is_rdna4 into gpu_arch.h alongside new is_rdna1 and
is_rdna2 helpers, with no behavior change on any GPU. Adds tests/test_gpu_arch.py
and updates tests/test_mma_software.py to read is_rdna4 from gpu_arch.h.

Assisted-by: Antigravity
fix(vk): fix non-4-aligned multi-layer BC mip-tail copy on RDNA 2 Windows and restore 8-layer runs on AMD Windows
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Website build and checks (pull_request) Failing after 47s
beanstalk/approval approved by madebyjordan (reviewed)
beanstalk/windows+amd-proprietary+gpu-rx-7xxx 0/1 pass, 0 running, 2 queued
beanstalk/windows+amd-proprietary+gpu-rx-9xxx 2/1 pass
beanstalk/linux+radv 2/1 pass
beanstalk/windows+nvidia-proprietary 2/1 pass
a724a837c7
Splits non-4-aligned multi-layer VkBufferImageCopy regions in bc_encode_into into one region per layer when dev.policy.bc_copy_per_layer is enabled (AMD RDNA 2 on AMD's Windows driver, overrideable via RX_VK_BC_COPY_PER_LAYER), fixing Hyrule Field's dark grid lines (#2006, #2107, #2110) without dropping 8-layer ASTC-to-BC batching.

With the root cause fixed on RDNA 2 Windows, restores DevicePolicy::bc_small_runs on AMD's Windows driver so 8-layer small-scratch runs and RX_VK_BC_LEVELS mip grouping run again instead of falling back to 1 layer per run (#2148).

Co-Authored-By: Antigravity <[email protected]>
Author
Member

Tested in game: Windows 11, AMD Radeon RX 6700 XT (1002:73df), AMD driver 26.10.1 (0x800161), headless castle-gate (HyruleField_Child) and HyruleField_Adult (noon): default (bc_small_runs=1, bc_copy_per_layer=1, 1024x1024 x8 small BC3 scratch) renders distant Hyrule Field terrain cleanly with zero grid lines and cuts the 1365x1365 x90 terrain array ASTC-on-GPU upload median from 2106 ms (RX_VK_BC_SMALL_LAYERS=1) to 1731 ms (-375 ms / -17.8%); RX_VK_BC_COPY_PER_LAYER=0 reproduces the dark grid seams on the same view.

Tested in game: Windows 11, AMD Radeon RX 6700 XT (1002:73df), AMD driver 26.10.1 (0x800161), headless castle-gate (HyruleField_Child) and HyruleField_Adult (noon): default (bc_small_runs=1, bc_copy_per_layer=1, 1024x1024 x8 small BC3 scratch) renders distant Hyrule Field terrain cleanly with zero grid lines and cuts the 1365x1365 x90 terrain array ASTC-on-GPU upload median from 2106 ms (RX_VK_BC_SMALL_LAYERS=1) to 1731 ms (-375 ms / -17.8%); RX_VK_BC_COPY_PER_LAYER=0 reproduces the dark grid seams on the same view.
Author
Member

In-game A/B screenshots (castle-gate, HyruleField_Child, RX 6700 XT, AMD Windows 26.10.1 / 0x800161)

Workaround off (RX_VK_BC_COPY_PER_LAYER=0, 8-layer runs): dark grid seams across the distant hills left and right of the drawbridge:
RX_VK_BC_COPY_PER_LAYER=0 (8 layers, grid lines visible)

main behavior (RX_VK_BC_SMALL_LAYERS=1, 1-layer runs, no small BC3 scratch): clean terrain, 2106 ms median ASTC-on-GPU upload on the two 1365x1365 x90 terrain arrays:
RX_VK_BC_SMALL_LAYERS=1 (1 layer, clean)

This PR default (bc_small_runs=1, bc_copy_per_layer=1, 1024x1024 x8 small BC3 scratch): clean terrain (zero grid lines) at 1731 ms median (-375 ms / -17.8% faster):
Default on this PR (8 layers + bc_copy_per_layer=1, clean)


@Beanstalk please test on Windows AMD RDNA 3 / RDNA 4 (RX 7000 / RX 9000, AMD Windows driver) on castle-gate (Hyrule Field) to confirm bc_small_runs=1, bc_copy_per_layer=0, the small BC3 scratch: 1024 x 1024, 8 layers, and clean distant terrain with no dark grid lines; and sanity-check Linux RADV and Windows NVIDIA on castle-gate (bc_small_runs=1, bc_copy_per_layer=0, unchanged).

### In-game A/B screenshots (`castle-gate`, `HyruleField_Child`, RX 6700 XT, AMD Windows `26.10.1` / `0x800161`) **Workaround off (`RX_VK_BC_COPY_PER_LAYER=0`, 8-layer runs):** dark grid seams across the distant hills left and right of the drawbridge: ![RX_VK_BC_COPY_PER_LAYER=0 (8 layers, grid lines visible)](https://git.magicbean.dev/attachments/f68d1fe9-4d39-4129-9e7c-2836e0f2d2fd) **`main` behavior (`RX_VK_BC_SMALL_LAYERS=1`, 1-layer runs, no small BC3 scratch):** clean terrain, `2106 ms` median ASTC-on-GPU upload on the two `1365x1365 x90` terrain arrays: ![RX_VK_BC_SMALL_LAYERS=1 (1 layer, clean)](https://git.magicbean.dev/attachments/38e4318e-3a3b-4b68-a8c0-b1453f1af5e5) **This PR default (`bc_small_runs=1`, `bc_copy_per_layer=1`, `1024x1024 x8` small BC3 scratch):** clean terrain (zero grid lines) at `1731 ms` median (`-375 ms` / `-17.8%` faster): ![Default on this PR (8 layers + bc_copy_per_layer=1, clean)](https://git.magicbean.dev/attachments/ef460993-49e4-421e-9343-9f3b778c2564) --- @Beanstalk please test on Windows AMD RDNA 3 / RDNA 4 (RX 7000 / RX 9000, AMD Windows driver) on `castle-gate` (Hyrule Field) to confirm `bc_small_runs=1`, `bc_copy_per_layer=0`, `the small BC3 scratch: 1024 x 1024, 8 layers`, and clean distant terrain with no dark grid lines; and sanity-check Linux RADV and Windows NVIDIA on `castle-gate` (`bc_small_runs=1`, `bc_copy_per_layer=0`, unchanged).
Member
Beanstalk test farm · an earlier run: commit a724a83 (the newer results are in a comment below)

Commit a724a83 · approved by madebyjordan (reviewed) · dashboard

⚠️ Note: The screenshot comparison detects changes against main, but cannot prove either image is free of dark grid lines if both contain them.
⚠️ Note: The scratch allocation check is unjudged if that allocation path is not reached; low-VRAM configurations can use a smaller scratch.

Started at 07:20 UTC.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
windows+amd-proprietary+gpu-rx-7xxx (GPU "rx 7xxx") ⏳ queued 0 of 1 — — —
windows+amd-proprietary+gpu-rx-9xxx (GPU "rx 9xxx") ✅ pass (an outlier) 2 1 2 19.4 → 19.1 (−1%) — none
linux+radv ✅ pass (an outlier) 2 1 2 18.2 → 18.2 (+0%) — none
windows+nvidia-proprietary ✅ pass (an outlier) 2 1 2 18.3 → 18.3 (+0%) — none
What was tested

What will be tested · AI plan (gpt-6.1-terra)

The plan compares the castle-gate view of Hyrule Field on Windows RX 7000 and RX 9000, Linux RADV, and Windows NVIDIA, taking about 20–25 minutes per tester. It checks the default BC policy and scratch allocation logs and compares distant terrain pictures against main; crashes, wrong policy logs, or significant picture differences fail. The RX 7000 target will wait for a matching tester; the online inventory does not list one. No tester online now matches windows+amd-proprietary+gpu-rx-7xxx: that target waits for one.

  • Where: windows+amd-proprietary+gpu-rx-7xxx (GPU "rx 7xxx", 1-2 reports), windows+amd-proprietary+gpu-rx-9xxx (GPU "rx 9xxx", 1-2 reports), linux+radv (1-2 reports), windows+nvidia-proprietary (1-2 reports).
  • castle-gate: from the repository's save castle-gate, then take the picture distant-terrain to compare with main, measure field for 15 s (after 5 s warm-up); 2 runs on each side.
  • Measured: crashes, numbers from the game's log, the game's log (an expected line that never appears: could not be judged), frame times, stutters and hitches.
  • The PR fails if: it crashes; or a picture differs from main by more than 1%; or frame time (p99) is more than 15% above main; or value_small_runs is below 1; or forbidden log lines is above 0; or expected log lines missing is above 0; or value_copy_per_layer is below 1.
  • Time: about 22 min of game runs per tester (4 game starts), plus the two builds.
Measurements on `windows+amd-proprietary+gpu-rx-9xxx`, for the PR description

Verdict: pass on windows+amd-proprietary+gpu-rx-9xxx (2 reports): no rule failed and no PR run crashed.

Hardware: 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9060 XT, 2.0.416 AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM; 2: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ a2dc538 After: this PR @ a724a83
castle-gate · field · frame time (p99) (ms) 19.4 19.1 (−1%)
castle-gate · value_small_runs 0.0 1.0
castle-gate · forbidden log lines 0.0 0.0
castle-gate · expected log lines missing 1.0 0.0 (−100%)
castle-gate · value_copy_per_layer 0.0 1.0

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on windows+amd-proprietary+gpu-rx-9xxx (2 reports): no rule failed and no PR run crashed.

Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`  
Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ a2dc538 | After: this PR @ a724a83 |
|---|---|---|
| castle-gate · field · frame time (p99) (ms) | 19.4 | 19.1 (−1%) |
| castle-gate · value_small_runs | 0.0 | 1.0 |
| castle-gate · forbidden log lines | 0.0 | 0.0 |
| castle-gate · expected log lines missing | 1.0 | 0.0 (−100%) |
| castle-gate · value_copy_per_layer | 0.0 | 1.0 |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `linux+radv`, for the PR description

Verdict: pass on linux+radv (2 reports): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.1.99 AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ a2dc538 After: this PR @ a724a83
castle-gate · field · frame time (p99) (ms) 18.2 18.2 (+0%)
castle-gate · value_small_runs 1.0 1.0 (+0%)
castle-gate · forbidden log lines 0.0 0.0
castle-gate · expected log lines missing 0.0 0.0
castle-gate · value_copy_per_layer 0.0 1.0

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on linux+radv (2 reports): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.1.99` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM`  
Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ a2dc538 | After: this PR @ a724a83 |
|---|---|---|
| castle-gate · field · frame time (p99) (ms) | 18.2 | 18.2 (+0%) |
| castle-gate · value_small_runs | 1.0 | 1.0 (+0%) |
| castle-gate · forbidden log lines | 0.0 | 0.0 |
| castle-gate · expected log lines missing | 0.0 | 0.0 |
| castle-gate · value_copy_per_layer | 0.0 | 1.0 |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `windows+nvidia-proprietary`, for the PR description

Verdict: pass on windows+nvidia-proprietary (2 reports): no rule failed and no PR run crashed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 621.24.0 AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 621.24.0 AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM
Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ a2dc538 After: this PR @ a724a83
castle-gate · field · frame time (p99) (ms) 18.3 18.3 (+0%)
castle-gate · value_small_runs 1.0 1.0 (+0%)
castle-gate · forbidden log lines 0.0 0.0
castle-gate · expected log lines missing 0.0 0.0
castle-gate · value_copy_per_layer 0.0 1.0

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on windows+nvidia-proprietary (2 reports): no rule failed and no PR run crashed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`  
Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ a2dc538 | After: this PR @ a724a83 |
|---|---|---|
| castle-gate · field · frame time (p99) (ms) | 18.3 | 18.3 (+0%) |
| castle-gate · value_small_runs | 1.0 | 1.0 (+0%) |
| castle-gate · forbidden log lines | 0.0 | 0.0 |
| castle-gate · expected log lines missing | 0.0 | 0.0 |
| castle-gate · value_copy_per_layer | 0.0 | 1.0 |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
windows+amd-proprietary+gpu-rx-9xxx 1 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9060 XT, 2.0.416 AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM
windows+amd-proprietary+gpu-rx-9xxx 2 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
linux+radv 1 linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.1.99 AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM
linux+radv 2 linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
windows+nvidia-proprietary 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 621.24.0 AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM
windows+nvidia-proprietary 2 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 621.24.0 AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>a724a83</code> (the newer results are in a comment below)</summary> Commit `a724a83` · approved by madebyjordan (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2228) ⚠️ **Note:** The screenshot comparison detects changes against main, but cannot prove either image is free of dark grid lines if both contain them. ⚠️ **Note:** The scratch allocation check is unjudged if that allocation path is not reached; low-VRAM configurations can use a smaller scratch. Started at 07:20 UTC. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows+amd-proprietary+gpu-rx-7xxx` (GPU "rx 7xxx") | ⏳ queued | 0 of 1 | — | — | — | | `windows+amd-proprietary+gpu-rx-9xxx` (GPU "rx 9xxx") | ✅ pass (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_7531cea7cd634bb6) [2](https://beanstalk.magicbean.dev/reports/rp_64fc55db033e5031) | 19.4 → 19.1 (−1%) | — | none | | `linux+radv` | ✅ pass (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_40c7928eb239508d) [2](https://beanstalk.magicbean.dev/reports/rp_fac5aa0d0f4b0e9b) | 18.2 → 18.2 (+0%) | — | none | | `windows+nvidia-proprietary` | ✅ pass (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_2457b66f6e63a483) [2](https://beanstalk.magicbean.dev/reports/rp_ec59ebd6f993b4b1) | 18.3 → 18.3 (+0%) | — | none | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares the castle-gate view of Hyrule Field on Windows RX 7000 and RX 9000, Linux RADV, and Windows NVIDIA, taking about 20–25 minutes per tester. It checks the default BC policy and scratch allocation logs and compares distant terrain pictures against main; crashes, wrong policy logs, or significant picture differences fail. The RX 7000 target will wait for a matching tester; the online inventory does not list one. No tester online now matches windows+amd-proprietary+gpu-rx-7xxx: that target waits for one. - **Where:** windows+amd-proprietary+gpu-rx-7xxx (GPU "rx 7xxx", 1-2 reports), windows+amd-proprietary+gpu-rx-9xxx (GPU "rx 9xxx", 1-2 reports), linux+radv (1-2 reports), windows+nvidia-proprietary (1-2 reports). - **castle-gate:** from the repository's save `castle-gate`, then take the picture distant-terrain to compare with main, measure field for 15 s (after 5 s warm-up); 2 runs on each side. - **Measured:** crashes, numbers from the game's log, the game's log (an expected line that never appears: could not be judged), frame times, stutters and hitches. - **The PR fails if:** it crashes; or a picture differs from main by more than 1%; or frame time (p99) is more than 15% above main; or value_small_runs is below 1; or forbidden log lines is above 0; or expected log lines missing is above 0; or value_copy_per_layer is below 1. - **Time:** about 22 min of game runs per tester (4 game starts), plus the two builds. </details> <details><summary>Measurements on `windows+amd-proprietary+gpu-rx-9xxx`, for the PR description</summary> **Verdict:** pass on windows+amd-proprietary+gpu-rx-9xxx (2 reports): no rule failed and no PR run crashed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ a2dc538 | After: this PR @ a724a83 | |---|---|---| | castle-gate · field · frame time (p99) (ms) | 19.4 | 19.1 (−1%) | | castle-gate · value_small_runs | 0.0 | 1.0 | | castle-gate · forbidden log lines | 0.0 | 0.0 | | castle-gate · expected log lines missing | 1.0 | 0.0 (−100%) | | castle-gate · value_copy_per_layer | 0.0 | 1.0 | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on windows+amd-proprietary+gpu-rx-9xxx (2 reports): no rule failed and no PR run crashed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ a2dc538 | After: this PR @ a724a83 | |---|---|---| | castle-gate · field · frame time (p99) (ms) | 19.4 | 19.1 (−1%) | | castle-gate · value_small_runs | 0.0 | 1.0 | | castle-gate · forbidden log lines | 0.0 | 0.0 | | castle-gate · expected log lines missing | 1.0 | 0.0 (−100%) | | castle-gate · value_copy_per_layer | 0.0 | 1.0 | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `linux+radv`, for the PR description</summary> **Verdict:** pass on linux+radv (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.1.99` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ a2dc538 | After: this PR @ a724a83 | |---|---|---| | castle-gate · field · frame time (p99) (ms) | 18.2 | 18.2 (+0%) | | castle-gate · value_small_runs | 1.0 | 1.0 (+0%) | | castle-gate · forbidden log lines | 0.0 | 0.0 | | castle-gate · expected log lines missing | 0.0 | 0.0 | | castle-gate · value_copy_per_layer | 0.0 | 1.0 | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on linux+radv (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.1.99` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ a2dc538 | After: this PR @ a724a83 | |---|---|---| | castle-gate · field · frame time (p99) (ms) | 18.2 | 18.2 (+0%) | | castle-gate · value_small_runs | 1.0 | 1.0 (+0%) | | castle-gate · forbidden log lines | 0.0 | 0.0 | | castle-gate · expected log lines missing | 0.0 | 0.0 | | castle-gate · value_copy_per_layer | 0.0 | 1.0 | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `windows+nvidia-proprietary`, for the PR description</summary> **Verdict:** pass on windows+nvidia-proprietary (2 reports): no rule failed and no PR run crashed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM` Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ a2dc538 | After: this PR @ a724a83 | |---|---|---| | castle-gate · field · frame time (p99) (ms) | 18.3 | 18.3 (+0%) | | castle-gate · value_small_runs | 1.0 | 1.0 (+0%) | | castle-gate · forbidden log lines | 0.0 | 0.0 | | castle-gate · expected log lines missing | 0.0 | 0.0 | | castle-gate · value_copy_per_layer | 0.0 | 1.0 | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on windows+nvidia-proprietary (2 reports): no rule failed and no PR run crashed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM` Scene: castle-gate, from the repository's save castle-gate; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); castle-gate: 2 game starts a side, field 15 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ a2dc538 | After: this PR @ a724a83 | |---|---|---| | castle-gate · field · frame time (p99) (ms) | 18.3 | 18.3 (+0%) | | castle-gate · value_small_runs | 1.0 | 1.0 (+0%) | | castle-gate · forbidden log lines | 0.0 | 0.0 | | castle-gate · expected log lines missing | 0.0 | 0.0 | | castle-gate · value_copy_per_layer | 0.0 | 1.0 | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows+amd-proprietary+gpu-rx-9xxx` | [1](https://beanstalk.magicbean.dev/reports/rp_7531cea7cd634bb6) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM` | | `windows+amd-proprietary+gpu-rx-9xxx` | [2](https://beanstalk.magicbean.dev/reports/rp_64fc55db033e5031) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` | | `linux+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_40c7928eb239508d) | linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.1.99` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM` | | `linux+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_fac5aa0d0f4b0e9b) | linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` | | `windows+nvidia-proprietary` | [1](https://beanstalk.magicbean.dev/reports/rp_2457b66f6e63a483) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM` | | `windows+nvidia-proprietary` | [2](https://beanstalk.magicbean.dev/reports/rp_ec59ebd6f993b4b1) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM` | </details> </details>
dazemc left a comment

Read of a724a837 on #2227's e8915426 (stacked on open #2227, so the diff includes its gpu_arch.h). The block-truncation fix is right and the single-layer path is untouched. One default mismatch is what I would change before this ships: the workaround is as narrow as RDNA 2 while the 8-layer runs it protects are as wide as every AMD Windows GPU.

1. bc_small_runs is re-enabled for f.amd_win(), but bc_copy_per_layer is f.amd_win() && f.rdna2() (device_policy.h:629 vs :563). So RDNA 1, GCN, RDNA 3 and RDNA 4 on AMD's Windows driver go back to 8-layer multi-layer copies into non-4-aligned mip tails — the exact copy the probe shows truncating — with no per-layer split. The policy test codifies it: the RX 5700 (RDNA 1) case expects bc_small_runs on and no bc_copy_per_layer (tests/test_device_policy.py:283-289), and the RDNA 3/4 and 860M cases likewise. Still to test covers RDNA 3/4 and Linux/NVIDIA only, so RDNA 1 and GCN are not scheduled at all. The split measured free (1731 vs 1746 ms — the PR's own "zero measurable overhead"), so unless the driver bug is known to be RDNA 2 hardware rather than this driver's copy path, either widen bc_copy_per_layer to f.amd_win() or keep the 8-layer runs at f.radv() || NVIDIA || (f.amd_win() && f.rdna2()) until the farm has looked; as written, the Risks' fallback ("widen if grid lines appear") means a player sees #2006 again before the widening. Good news on scope: the grouped RX_VK_BC_LEVELS copies are single-layer (layerCount = 1, vk_texture.cpp:1513) and the resident upload copies are too (:2442, layerCount = 1), so bc_encode_into is the only multi-layer compressed copy — the workaround is complete where it applies.

2. The fix itself is correct. The condition n > 1 && ((w & 3) || (h & 3)) matches the probe's trigger; the per-layer regions use bufferOffset = i * layer_bytes (layer_bytes = blocks_x * blocks_y * 16, the encoder's layout), bufferRowLength = blocks_x * 4, bufferImageHeight = blocks_y * 4, baseArrayLayer = layer + i, layerCount = 1, the same {dx, dy}, and one call per 8 regions (vk_texture.cpp:1154-1168). The offsets are whole 16-byte blocks and the row pitch whole blocks, as Vulkan wants for BC; the 8-layer decode/encode run is kept (it is only the copy that is split), and n <= 8 stays one vkCmdCopyBufferToImage. The 4-aligned case and n == 1 take the old single region unchanged.

3. The test fails on main for the bug's reason: with per_layer=1 it expects n regions and main always emits one (tests/test_bc_copy_layer_pitch.py:78-101). It runs both switch states over 5x5, 6x6, 9x9, 683x170, 1024x1024 and a single-layer 1365, checking mip, base layer, layerCount, pitch, extent, offset, and that n <= 8 is one call. It cannot prove the driver's truncation (the standalone probe does); the 90-layer terrain array is modelled by the offset arithmetic, not by a 90-region call — which is fine while n <= 8, but worth a line in the test or the body that the run size is the ceiling.

4. The single-layer path is not regressed: the n > 1 guard keeps it on the old single region, and the (1365, 1365, 1) case is run with both switch values.

5. The default row RX_VK_BC_COPY_PER_LAYER (hw, on only for RDNA 2 Windows, logged with (seen on 0x800161)) matches the code and the measurement; the mismatch in 1 is in bc_small_runs, not in this row. The dependency on #2227 is real (this cannot merge first); the Raphael iGPU case in the policy test confirms rdna2() includes RDNA 2 APUs.

No approval, and no claim on it.

**Read of `a724a837` on #2227's `e8915426` (stacked on open #2227, so the diff includes its `gpu_arch.h`).** The block-truncation fix is right and the single-layer path is untouched. One default mismatch is what I would change before this ships: the workaround is as narrow as RDNA 2 while the 8-layer runs it protects are as wide as every AMD Windows GPU. **1. `bc_small_runs` is re-enabled for `f.amd_win()`, but `bc_copy_per_layer` is `f.amd_win() && f.rdna2()`** (`device_policy.h:629` vs `:563`). So RDNA 1, GCN, RDNA 3 and RDNA 4 on AMD's Windows driver go back to 8-layer multi-layer copies into non-4-aligned mip tails — the exact copy the probe shows truncating — with no per-layer split. The policy test codifies it: the RX 5700 (RDNA 1) case expects `bc_small_runs` on and no `bc_copy_per_layer` (`tests/test_device_policy.py:283-289`), and the RDNA 3/4 and 860M cases likewise. Still to test covers RDNA 3/4 and Linux/NVIDIA only, so **RDNA 1 and GCN are not scheduled at all**. The split measured free (1731 vs 1746 ms — the PR's own "zero measurable overhead"), so unless the driver bug is known to be RDNA 2 hardware rather than this driver's copy path, either widen `bc_copy_per_layer` to `f.amd_win()` or keep the 8-layer runs at `f.radv() || NVIDIA || (f.amd_win() && f.rdna2())` until the farm has looked; as written, the Risks' fallback ("widen if grid lines appear") means a player sees #2006 again before the widening. Good news on scope: the grouped `RX_VK_BC_LEVELS` copies are single-layer (`layerCount = 1`, `vk_texture.cpp:1513`) and the resident upload copies are too (`:2442`, `layerCount = 1`), so `bc_encode_into` is the only multi-layer compressed copy — the workaround is complete where it applies. **2. The fix itself is correct.** The condition `n > 1 && ((w & 3) || (h & 3))` matches the probe's trigger; the per-layer regions use `bufferOffset = i * layer_bytes` (`layer_bytes = blocks_x * blocks_y * 16`, the encoder's layout), `bufferRowLength = blocks_x * 4`, `bufferImageHeight = blocks_y * 4`, `baseArrayLayer = layer + i`, `layerCount = 1`, the same `{dx, dy}`, and one call per 8 regions (`vk_texture.cpp:1154-1168`). The offsets are whole 16-byte blocks and the row pitch whole blocks, as Vulkan wants for BC; the 8-layer decode/encode run is kept (it is only the copy that is split), and `n <= 8` stays one `vkCmdCopyBufferToImage`. The 4-aligned case and `n == 1` take the old single region unchanged. **3. The test fails on main for the bug's reason**: with `per_layer=1` it expects `n` regions and main always emits one (`tests/test_bc_copy_layer_pitch.py:78-101`). It runs both switch states over 5x5, 6x6, 9x9, 683x170, 1024x1024 and a single-layer 1365, checking mip, base layer, layerCount, pitch, extent, offset, and that `n <= 8` is one call. It cannot prove the driver's truncation (the standalone probe does); the 90-layer terrain array is modelled by the offset arithmetic, not by a 90-region call — which is fine while `n <= 8`, but worth a line in the test or the body that the run size is the ceiling. **4. The single-layer path is not regressed**: the `n > 1` guard keeps it on the old single region, and the `(1365, 1365, 1)` case is run with both switch values. **5. The default row** `RX_VK_BC_COPY_PER_LAYER` (`hw`, on only for RDNA 2 Windows, logged with `(seen on 0x800161)`) matches the code and the measurement; the mismatch in 1 is in `bc_small_runs`, not in this row. The dependency on #2227 is real (this cannot merge first); the Raphael iGPU case in the policy test confirms `rdna2()` includes RDNA 2 APUs. No approval, and no claim on it.
madebyjordan force-pushed fix/bc-copy-per-layer from a724a837c7
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Website build and checks (pull_request) Failing after 47s
beanstalk/approval approved by madebyjordan (reviewed)
beanstalk/windows+amd-proprietary+gpu-rx-7xxx 0/1 pass, 0 running, 2 queued
beanstalk/windows+amd-proprietary+gpu-rx-9xxx 2/1 pass
beanstalk/linux+radv 2/1 pass
beanstalk/windows+nvidia-proprietary 2/1 pass
to 3bab53e063
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
Third-party parts / As their notes say (pull_request) Successful in 13s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Failing after 7s
CI / Website build and checks (pull_request) Failing after 2m3s
2026-11-22 09:03:58 +00:00
Compare
Member

Beanstalk test farm

Commit 3bab53e · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `3bab53e` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2228) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
madebyjordan changed title from fix(vk): fix RDNA 2 Windows multi-layer BC mip-tail copy and restore 8-layer runs on AMD Windows to fix(vk): split non-4-aligned multi-layer BC mip-tail copies on AMD Windows and restore 8-layer runs 2026-11-22 09:04:59 +00:00
Author
Member

Updated in 3bab53e06 (rebased onto updated #2227 218a728d9) to address Review #2314:

  • Widened bc_copy_per_layer to f.amd_win() (gpu/vk/device_policy.h, gpu/vk/switches.def, tests/test_device_policy.py), matching bc_small_runs symmetrically so RDNA 1, RDNA 3, GCN, and RDNA 4 on AMD's Windows driver are all protected by the zero-overhead per-layer split instead of risking #2006 regressions on untested generations.
  • Expanded tests/test_bc_copy_layer_pitch.py to also check non-zero (dx, dy) sub-region offsets (as texture_copy_into_bc) and n = 10 (> kBcLayers = 8) to verify the chunked vkCmdCopyBufferToImage loop (ceil(n / 8) calls).
  • Verified dev.py vk (longshot_vk.dll) and game-free tests (test_bc_copy_layer_pitch.py, test_bc_small_scratch.py, test_device_policy.py, test_gpu_arch.py, test_astc_upload_chunking.py, test_doc_anchors.py) pass on both clang++ and g++.
Updated in `3bab53e06` (rebased onto updated #2227 `218a728d9`) to address Review #2314: - **Widened `bc_copy_per_layer` to `f.amd_win()`** (`gpu/vk/device_policy.h`, `gpu/vk/switches.def`, `tests/test_device_policy.py`), matching `bc_small_runs` symmetrically so RDNA 1, RDNA 3, GCN, and RDNA 4 on AMD's Windows driver are all protected by the zero-overhead per-layer split instead of risking #2006 regressions on untested generations. - **Expanded `tests/test_bc_copy_layer_pitch.py`** to also check non-zero `(dx, dy)` sub-region offsets (as `texture_copy_into_bc`) and `n = 10` (> `kBcLayers = 8`) to verify the chunked `vkCmdCopyBufferToImage` loop (`ceil(n / 8)` calls). - Verified `dev.py vk` (`longshot_vk.dll`) and game-free tests (`test_bc_copy_layer_pitch.py`, `test_bc_small_scratch.py`, `test_device_policy.py`, `test_gpu_arch.py`, `test_astc_upload_chunking.py`, `test_doc_anchors.py`) pass on both `clang++` and `g++`.
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
Third-party parts / As their notes say (pull_request) Successful in 13s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Failing after 7s
CI / Website build and checks (pull_request) Failing after 2m3s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/bc-copy-per-layer:madebyjordan-fix/bc-copy-per-layer'
git switch 'madebyjordan-fix/bc-copy-per-layer'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2228
No description provided.