graphics: map RGB9E5 color buffers to a renderable host format #2290
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2290
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2290"
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?
@saironbusatto on GitHub · 2026-11-15 15:57 UTC · original
saironbusatto:fix/ufc6-rgb9e5-format→main· +3 −1 · 1 files · 1 commits · openGame and problem
EA SPORTS UFC 6 (PPSA23566) uses RGB9E5 (
k9_9_9_5Float) color buffers and clears them as render targets. Kyty maps that format tovk::Format::eE5B9G9R9UfloatPack32, which is not renderable as a color attachment on NVIDIA, so those clears/targets fail on the cards the game is most commonly tested with (every compatibility report so far is NVIDIA or AMD).Cause
kFormatMappingsmapsProspero::BufferFormat::k9_9_9_5Floatdirectly toeE5B9G9R9UfloatPack32. That format lacks renderable color-attachment support on NVIDIA drivers, whileeB10G11R11UfloatPack32is renderable everywhere and also occupies 32 bits.Fix
Map
k9_9_9_5FloattoeB10G11R11UfloatPack32as a stand-in. The tradeoff is intentional and noted in a comment: guest-uploaded RGB9E5 texel data decodes wrong under the stand-in (the exponent-prefixed 9-bit channels are not bit-identical to B10G11R11), so a shader-side pack will still be needed to decode guest texel uploads correctly. What this buys is a renderable target so clears and writes succeed.Result
UFC 6 (PPSA23566) on Linux, RTX GPU: with this mapping the game reaches the menu and the pre-fight presentation with correct colors throughout, where the default mapping fails on the same build. Colors stayed correct across menu and world scenes; the known decode caveat only matters for guest texel uploads, which the tested path did not hit.
@coderabbitai[bot] on GitHub · 2026-11-15 16:00 UTC · original
Walkthrough
The
k9_9_9_5Floatguest format now maps to Vulkan’seB10G11R11UfloatPack32instead ofeE5B9G9R9UfloatPack32. Comments describe the NVIDIA renderability limitation and note that guest-uploaded RGB9E5 texels decode incorrectly without shader-side packing.Suggested reviewers:
nmzikChange: Bug fix · Severity of issue fixed: Low
Merge Risk:
Moderate · up to
9be40RGB9E5 render targets now use a stand-in host format. Register-based clears and guest readback of these targets can produce wrong colors or data. The tested game path works, but these related paths should be fixed or explicitly accepted before merge.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: RGB9E5 color buffers are mapped to a renderable host format. The raw summary confirms that k9_9_9_5Float now maps to eB10G11R11UfloatPack32 instead of eE5B9G9R9UfloatPack32, so the title matches the changeset.
Full details: Description check
Explanation
The description states the game, the problem (RGB9E5 color buffers mapped to a format that is not renderable on NVIDIA), the cause in kFormatMappings, the stand-in fix, and the known tradeoff for guest texel uploads. This matches the raw summary's change to vulkanCommon.cpp.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@coderabbitai[bot] on GitHub · 2026-11-15 16:01 UTC · original · reviewed
Actionable comments posted: 2
4ea42621-9082-43d2-9e63-e8eebdb64fbfReviewing files that changed from the base of the PR and between
3acafb358fand9be408d2de.src/graphics/host_gpu/vulkanCommon.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
@ -79,1 +79,3 @@{Prospero::BufferFormat::k9_9_9_5Float, vk::Format::eE5B9G9R9UfloatPack32},// RGB9E5 is not renderable on NVIDIA; B10G11R11 is a renderable 32-bit HDR stand-in.// Guest-uploaded RGB9E5 texel data will decode wrong; add a shader-side pack if colors break.{Prospero::BufferFormat::k9_9_9_5Float, vk::Format::eB10G11R11UfloatPack32},@coderabbitai[bot] on GitHub · 2026-11-15 16:01 UTC · original
Render-target readback exposes B10G11R11 bits for RGB9E5 targets.
For a
k9_9_9_5Floatimage,ImageInfo::GetColorTransform()returnsNone.TextureCache::DownloadImagethen copies host bytes raw into the guest-facing download buffer. When readback is enabled, the guest can read these bytes as RGB9E5 data, but they use B10G11R11 layout. The PR description covers only guest texel uploads, not this readback direction.Add an RGB9E5-to-B10G11R11 transform to the readback path, and a matching inverse on upload, so the guest sees RGB9E5 encoding. Alternatively, keep the stand-in mapping off any readback-enabled path for this format.
Decode RGB9E5 register clear words with the RGB9E5 layout.
For an RGB9E5 color target with DCC or CMASK clear metadata, a register clear passes the raw guest word to
DecodePackedColorClearwith the B10G11R11 host format. That decoder reads the word as B10G11R11, so the clear color is wrong. For example, the word0x80000000is black in RGB9E5 but decodes to blue = 2.0 as B10G11R11. The PR's texel caveat covers uploads only, not this clear path.Select the layout from
desc.info.guest_formatinDecodeColorClear. When it isk9_9_9_5Float, decode the word as RGB9E5 (shared 5-bit exponent, three 9-bit mantissas) before writing the float channels. Do not pass the word to the B10G11R11 decoder in that case.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.