vkback: A8_UNORM as A8_UNORM_KHR without view swizzle, as vkd3d-proton #29
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!29
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-29"
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?
@Flezzonkeys on GitHub · 2026-11-30 22:31 UTC · original
Flezzonkeys:a8-unorm→main· +58 −25 · 10 files · 2 commits · merged 2026-12-01 07:49 UTCWhat
DXGI 65 (A8_UNORM) is made as
VK_FORMAT_A8_UNORM_KHRand its views take no swizzle, as vkd3d-proton does.Why
vkback made A8 as R8_UNORM with the (0,0,0,R) view swizzle of vkd3d-proton's R8 emulation. As a render target, R8 keeps red and drops the alpha the pixel shader exports. The UI draws its text through full-screen A8 masks (3840x2160) that are render targets, so those masks stayed empty and the text was masked out: the controls menu's left list and the tab names between LB/RB, and the notoriety HUD. Other text was fine.
Reference (rule 12): vkd3d-proton
libs/vkd3d/utils.c:106mapsDXGI_FORMAT_A8_UNORMtoVK_FORMAT_A8_UNORM_KHR.resource.cvkd3d_set_view_swizzle_for_formatapplies (0,0,0,R) only whenvk_format != VK_FORMAT_A8_UNORM_KHR. Carried over: the format and the dropped swizzle. Left out: vkd3d-proton's R8 fallback for devices without VK_KHR_maintenance5 (see below).Changes
fmt.rs: 65 ->A8_UNORM_KHR.viewdesc.rscomponents: no A8 swizzle (test updated).frame/vkformat.rs: the 65 row names A8_UNORM_KHR (one fact, rule 3).vk-texdiff: both sides compare A8 as A8_UNORM_KHR (the R8 fold is gone).clear.rs,pixprobe.rs,present/shot.rs: the new format in clear values, probe decode and texel size.docs/learnings/a8-unorm.md(with two corrections: the stencil suspect, and format without dropping the swizzle made all text vanish), index row,parity.mdglyphs line.Verification
cargo test -p vkback(148 lib + policy 6),cargo testingreenfield/frame,cargo xtask policy: pass.Found outside this change (rule 29)
dev.rs:80-94: VK_KHR_maintenance5 is enabled only when the device has it, and nothing fails when it is missing. A8_UNORM_KHR now depends on it, so a device without it would create invalid images without a log line.VUID-VkSparseMemoryBind-memory-02730on main (not on the TASKS.md list) #42@vktory6 on GitHub · 2026-12-01 07:49 UTC · original
Merged, thanks! One small commit of mine on top (
db6fa45):65 && R8_UNORMexception. With this change the format is A8 on both sides, so the exception would only hide a real mismatch.Check on the reference system (RX 9070 XT): tests and policy pass, and the house-scene validation run shows no new error.