mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #2268] Quantize RGB565 render-target clears at each channel width #2273
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#2273
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/2268
Author: @Bonchaloo
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/rgb565-rtv-clear📝 Commits (1)
1e0de21Quantize RGB565 render-target clears at each channel width📊 Changes
2 files changed (+3 additions, -0 deletions)
View changed files
📝
runtime/src/vulkan_replay.h(+1 -0)📝
runtime/test/clear_color_test.cpp(+2 -0)📄 Description
Claimed in the coordination issue as RT-CLEAR-RGB565-UNORM.
What and why
The RTV replay path already pre-rounds normalized clear values so the conversion is independent of the driver’s tie handling. RGB565 fell through to the raw float path. Apply the existing converter with channel maxima of 31, 63 and 31. Cover full and rectangle clears, midpoint rounding, NaN and clamping.
Tested
On the parent revision the new midpoint case failed (red 0.5, expected 16/31). With the change all 519 clear replay checks passed. The no-game-data check passed for both changed files.
GPUs tested: Apple M5 Max, Apple Metal driver on macOS 27.3. A separate native Metal RGB565 clear and readback produced 0x8410 for both the raw and pre-rounded midpoint. That device already rounds this case the same way. The failing regression was at the renderer’s Vulkan command boundary; the replay test uses synthetic inputs and captures the clear without a GPU.
Full native runtime CTest suite on Apple M5 Max with MoltenVK 1.4.2: 105 passed, 0 failed, 3 skipped (shader_library_corpus, vk_device_markers, vk_sync_validation).
AI-assisted: yes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.