mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #434] [MERGED] vulkan_replay: honor format alignment, block size, and depth in tile_footprint staging #487
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#487
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/434
Author: @tahffo68hk-hash
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:fix/vk-tile-copy-align📝 Commits (1)
cfb3436vulkan_replay: honor format alignment, block size, and depth in tile_footprint staging📊 Changes
2 files changed (+138 additions, -14 deletions)
View changed files
📝
runtime/src/vulkan_replay.h(+41 -14)📝
runtime/test/replay_copy_offset_test.cpp(+97 -0)📄 Description
Summary
(AI-assisted) Fixes VK-TILE-COPY-ALIGN in
untime/src/vulkan_replay.h:
ow_bytes and pitch, ignored mt.block for block-compressed formats, ignored imageExtent.depth > 1 (only copying slice 0), left ufferImageHeight non-zero on the tightly-packed scratch region, and did not guard against
gb96 / depth24_as_float paths that read uffer.buffer directly.
Changes
untime/src/vulkan_replay.h:
ow_bytes, pitch, slice_rows, slice_pitch, and depth slices from BlockFormat, clear ufferImageHeight = 0 alongside ufferRowLength = 0, and reject unsupported
gb96 / depth24_as_float unaligned tile staging.
untime/test/replay_copy_offset_test.cpp: Add regression coverage for 8-byte 3D (VK_FORMAT_R16G16B16A16_SFLOAT) and block-compressed (VK_FORMAT_BC1_RGBA_UNORM_BLOCK) ile_footprint copies with offset = 4, verifying scratch size, per-row/per-slice VkBufferCopy offsets/sizes, aligned VkBufferImageCopy::bufferOffset, and cleared ufferRowLength/ufferImageHeight.
Verification
eplay_copy_offset_test with MSVC 19.44 + Ninja and ran ctest -R "^replay_copy_offset$" --output-on-failure: 1/1 PASS (0.16s).
中文翻译
摘要
(AI 辅助)修复
untime/src/vulkan_replay.h 中的 VK-TILE-COPY-ALIGN:
ow_bytes 与 pitch 硬编码乘以 4,未处理块压缩格式的 mt.block,未拷贝 depth > 1 的后续切片且未清零 ufferImageHeight,也未拦截与暂存路径冲突的
gb96 / depth24_as_float 路径。
改动
untime/src/vulkan_replay.h:按 copy_block_format(image, aspectMask) 计算真实格式对齐;泛化 stage_unaligned_tile() 支持任意元素字节数、块压缩尺寸与 3D 切片,并清零 ufferImageHeight。
untime/test/replay_copy_offset_test.cpp:新增 8 字节 3D(R16G16B16A16_SFLOAT)与 BC1_RGBA_UNORM_BLOCK 在 offset=4 下的回归测试,验证暂存大小、行/切片步长及 VkBufferImageCopy 对齐参数。
验证
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.