graphics: map RGB9E5 color buffers to a renderable host format #2290

Open
github-bot wants to merge 1 commit from github-bot/gh-2290 into main AGit
Owner

@⁠saironbusatto on GitHub · 2026-11-15 15:57 UTC · original
saironbusatto:fix/ufc6-rgb9e5-format → main · +3 −1 · 1 files · 1 commits · open

Game 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 to vk::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

kFormatMappings maps Prospero::BufferFormat::k9_9_9_5Float directly to eE5B9G9R9UfloatPack32. That format lacks renderable color-attachment support on NVIDIA drivers, while eB10G11R11UfloatPack32 is renderable everywhere and also occupies 32 bits.

Fix

Map k9_9_9_5Float to eB10G11R11UfloatPack32 as 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.

**@⁠saironbusatto** on GitHub · 2026-11-15 15:57 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2290) `saironbusatto:fix/ufc6-rgb9e5-format` → `main` · +3 −1 · 1 files · 1 commits · open ## Game 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 to `vk::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 `kFormatMappings` maps `Prospero::BufferFormat::k9_9_9_5Float` directly to `eE5B9G9R9UfloatPack32`. That format lacks renderable color-attachment support on NVIDIA drivers, while `eB10G11R11UfloatPack32` is renderable everywhere and also occupies 32 bits. ## Fix Map `k9_9_9_5Float` to `eB10G11R11UfloatPack32` as 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.
eE5B9G9R9UfloatPack32 cannot be used as a color attachment on NVIDIA,
and UFC 6 (PPSA23566) clears RGB9E5 targets, which fails device
creation or the render pass. Map k9_9_9_5Float to the renderable
eB10G11R11UfloatPack32 as a stand-in; guest RGB9E5 texels decode
wrong until a shader-side pack exists.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:18:16 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-15 16:00 UTC · original

Explain Change →

Walkthrough

The k9_9_9_5Float guest format now maps to Vulkan’s eB10G11R11UfloatPack32 instead of eE5B9G9R9UfloatPack32. Comments describe the NVIDIA renderability limitation and note that guest-uploaded RGB9E5 texels decode incorrectly without shader-side packing.

Suggested reviewers: nmzik

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Moderate · up to 9be40

RGB9E5 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: Passed 4

Check name Status Explanation
Title check Passed 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 eE5B9G9R9UfloatP…
Description check Passed 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 gues…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2290#issuecomment-6897276859) <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/2290?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> The `k9_9_9_5Float` guest format now maps to Vulkan’s `eB10G11R11UfloatPack32` instead of `eE5B9G9R9UfloatPack32`. Comments describe the NVIDIA renderability limitation and note that guest-uploaded RGB9E5 texels decode incorrectly without shader-side packing. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"9be408d2de7988668871eb29d02eef61e455ac06" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix · **Severity of issue fixed:** Low <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Moderate</strong> · up to <code>9be40</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `9be40` --> <!-- final_review_risk_coverage:{"sourceCommitId":"9be408d2de7988668871eb29d02eef61e455ac06","coveredCommitId":"9be408d2de7988668871eb29d02eef61e455ac06","kind":"reviewed"} --> RGB9E5 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. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | 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 eE5B9G9R9UfloatP… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | 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 gues… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **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. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **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. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2290)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-15 16:01 UTC · original · reviewed

Actionable comments posted: 2

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3acafb358f and 9be408d2de.

Files selected for processing: 1

  • src/graphics/host_gpu/vulkanCommon.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-15 16:01 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2290#pullrequestreview-5911609880) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 2** <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/3acafb358f5a136ed7b5ca847476c3ebb2c78750/.coderabbit.yaml>) - **Commit**: [3acafb3](<https://github.com/KytyPS5/KytyPS5/commit/3acafb358f5a136ed7b5ca847476c3ebb2c78750>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `4ea42621-9082-43d2-9e63-e8eebdb64fbf` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 3acafb358f5a136ed7b5ca847476c3ebb2c78750 and 9be408d2de7988668871eb29d02eef61e455ac06. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 1</summary> <dl> <dd> <br> * `src/graphics/host_gpu/vulkanCommon.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=596ea880-c92c-45e2-9af5-26b5a28c3dac attempt=0ff36e2b-8e05-4bd4-9f88-057c5cfaacc9 batch=1/1 -->
@ -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},
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-15 16:01 UTC · original

Major · Data Integrity & Integration · Heavy lift

Render-target readback exposes B10G11R11 bits for RGB9E5 targets.

For a k9_9_9_5Float image, ImageInfo::GetColorTransform() returns None. TextureCache::DownloadImage then 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.


Major · Functional Correctness · Quick win

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 DecodePackedColorClear with the B10G11R11 host format. That decoder reads the word as B10G11R11, so the clear color is wrong. For example, the word 0x80000000 is 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_format in DecodeColorClear. When it is k9_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.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-15 16:01 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2290#discussion_r4579117672) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Data Integrity & Integration** · **Heavy lift** **Render-target readback exposes B10G11R11 bits for RGB9E5 targets.** For a `k9_9_9_5Float` image, `ImageInfo::GetColorTransform()` returns `None`. `TextureCache::DownloadImage` then 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. <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:e972081777a246308a670354 --> --- **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Quick win** **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 `DecodePackedColorClear` with the B10G11R11 host format. That decoder reads the word as B10G11R11, so the clear color is wrong. For example, the word `0x80000000` is 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_format` in `DecodeColorClear`. When it is `k9_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. <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:eab0509bb6deeff214544149 --> <!-- This is an auto-generated comment by CodeRabbit -->
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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 origin '+refs/pull/2290/head:github-bot/gh-2290'
git switch 'github-bot/gh-2290'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2290'
git switch 'github-bot/gh-2290'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2290'
git switch 'github-bot/gh-2290'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2290'
git switch 'main'
git merge --squash 'github-bot/gh-2290'
git switch 'main'
git merge --ff-only 'github-bot/gh-2290'
git switch 'main'
git merge 'github-bot/gh-2290'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.