graphics: restore block image storage usage where the device supports it #894

Manually merged
github merged 1 commit from gh-pr/894/head into gh-pr/894/base 2026-11-26 09:36:28 +00:00
Owner

@⁠joaodiaslobo on GitHub · 2026-09-28 20:49 UTC · original
joaodiaslobo:graphics/block-image-storage → main · +23 −3 · 1 files · 1 commits · merged 2026-09-28 21:57 UTC

Fixes texture problems reported in #698. Block compressed textures render black in Stray, and it affects any game whose shaders write BC data.

Block compressed images were created without storage usage, while their create flags still allowed uncompressed views of their blocks. A shader that writes BC blocks through one of those views therefore could not use the image as a storage image, leaving the texture black.

Storage usage for a compressed format is optional, and image creation can fail when the device rejects the requested usage, so it cannot simply be enabled for every block-compressed image. This change queries the device first. If it supports storage for that format, the image is created with storage usage. Otherwise, storage is omitted and a one-time warning explains why those textures will not render.

Before After
before after

Testing

Stray (PPSA02100). Textures render correctly again and no warning is printed. Tested on Windows with clang-cl.

**@⁠joaodiaslobo** on GitHub · 2026-09-28 20:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/894) `joaodiaslobo:graphics/block-image-storage` → `main` · +23 −3 · 1 files · 1 commits · merged 2026-09-28 21:57 UTC Fixes texture problems reported in #698. Block compressed textures render black in Stray, and it affects any game whose shaders write BC data. Block compressed images were created without storage usage, while their create flags still allowed uncompressed views of their blocks. A shader that writes BC blocks through one of those views therefore could not use the image as a storage image, leaving the texture black. Storage usage for a compressed format is optional, and image creation can fail when the device rejects the requested usage, so it cannot simply be enabled for every block-compressed image. This change queries the device first. If it supports storage for that format, the image is created with storage usage. Otherwise, storage is omitted and a one-time warning explains why those textures will not render. | **Before** | **After** | :-------------------------:|:-------------------------: <img width="1280" height="720" alt="before" src="https://github.com/user-attachments/assets/0464cda3-a991-4fac-a781-3f101e754b85" /> | <img width="1280" height="720" alt="after" src="https://github.com/user-attachments/assets/2b178227-2eb7-4ef2-9ced-3cbf0c7f5b05" /> **Testing** Stray (PPSA02100). Textures render correctly again and no warning is printed. Tested on Windows with clang-cl.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:36:26 +00:00
github manually merged commit 4b3c1df035 into gh-pr/894/base 2026-11-26 09:36:28 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-28 20:56 UTC · original

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: fac1dad4-71fb-4c57-98c8-9436d2af9c91

📥 Commits

Reviewing files that changed from the base of the PR and between 4b0de1b672 and 4b3c1df035.

📒 Files selected for processing (1)
  • src/graphics/host_gpu/renderer/image/image.cpp

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


📝 Walkthrough

Walkthrough

Block-compressed images use transfer and sampled usage. When block-texel views are enabled, the code queries whether storage usage is supported. It adds storage usage if the query succeeds. If the query fails, it keeps the existing usage and logs a warning once. Other formats continue through the existing format-feature checks.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4b3c1

Supported block-compressed images can gain storage usage, while unsupported images retain transfer and sampled usage. No merge-blocking issue was identified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 4b3c1

Storage access is added only when the selected device supports it, and image creation retains its validation checks. No new security bypass was identified. Some runtime and concurrency behavior remains unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed capability applies to block-compressed images created by this renderer on devices that accept the requested storage usage; the examined change does not alter a service or credential boundary.

Trust Boundaries and Controls

  • observed — Guest image parameters do not alone grant storage usage: the host-device gate, format query, final creation validation, and backing-image view usage constrain the path.

Resilience and Maintainability Implications

  • observed — Storage descriptor binding requests shader read/write access, and image state tracking emits a barrier for repeated shader writes. Image teardown retains view-before-backing-image destruction.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely states that block image storage usage is restored when the device supports it. This matches the main change.
Description check ✅ Passed The description directly explains the block-compressed image issue, the device-support query, the fallback warning, and the reported test result.
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.

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

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-28 20:56 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/894#issuecomment-5878384876) <!-- 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/894?cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> Navigate logical layers of code changes, visualize relationships, and explore their blast radius. <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `fac1dad4-71fb-4c57-98c8-9436d2af9c91` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 4b0de1b67265069110492e5e1005d5c7635043a9 and 4b3c1df0351452f2eeacc34113bc0f0f4b2fe224. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/graphics/host_gpu/renderer/image/image.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Block-compressed images use transfer and sampled usage. When block-texel views are enabled, the code queries whether storage usage is supported. It adds storage usage if the query succeeds. If the query fails, it keeps the existing usage and logs a warning once. Other formats continue through the existing format-feature checks. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"4b3c1df0351452f2eeacc34113bc0f0f4b2fe224" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _⚪ Minimal_ · up to `4b3c1` <!-- final_review_risk_coverage:{"sourceCommitId":"4b3c1df0351452f2eeacc34113bc0f0f4b2fe224","coveredCommitId":"4b3c1df0351452f2eeacc34113bc0f0f4b2fe224","kind":"reviewed"} --> Supported block-compressed images can gain storage usage, while unsupported images retain transfer and sampled usage. No merge-blocking issue was identified. <!-- final_review_risk_end --> <!-- architecture_review_start --> ### Security Architecture Review **Security architecture risk:** _🔵 Low_ · up to `4b3c1` Storage access is added only when the selected device supports it, and image creation retains its validation checks. No new security bypass was identified. Some runtime and concurrency behavior remains unverified. **Retained concerns** No architecture-level concerns identified. <details> <summary>Security review details</summary> **Security Blast Radius** - _inferred_ — The changed capability applies to block-compressed images created by this renderer on devices that accept the requested storage usage; the examined change does not alter a service or credential boundary. **Trust Boundaries and Controls** - _observed_ — Guest image parameters do not alone grant storage usage: the host-device gate, format query, final creation validation, and backing-image view usage constrain the path. **Resilience and Maintainability Implications** - _observed_ — Storage descriptor binding requests shader read/write access, and image state tracking emits a barrier for repeated shader writes. Image teardown retains view-before-backing-image destruction. </details> <!-- architecture_review_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | | Title check | ✅ Passed | The title clearly and concisely states that block image storage usage is restored when the device supports it. This matches the main change. | | Description check | ✅ Passed | The description directly explains the block-compressed image issue, the device-support query, the fallback warning, and the reported test result. | | 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. | </details> </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=894)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [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) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠Nmzik on GitHub · 2026-09-28 21:57 UTC · original

@⁠joaodiaslobo Nice!

**@⁠Nmzik** on GitHub · 2026-09-28 21:57 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/894#issuecomment-5879489696) @⁠joaodiaslobo Nice!
This discussion has been locked. Commenting is limited to contributors.
No description provided.