tests: probe the depth-stencil format with the usage the renderer requests #2118

Open
github-bot wants to merge 2 commits from github-bot/gh-2118 into main AGit
Owner

@⁠theantipopau on GitHub · 2026-11-04 23:18 UTC · original
theantipopau:fix/depth-stencil-usage-mask → main · +165 −41 · 1 files · 2 commits · open

Image::Image does not degrade when the device refuses a format/usage/sample combination: it calls EXIT. The texture-cache fixtures hardcode VK_FORMAT_D24_UNORM_S8_UINT, so on a device that rejects it they abort before reporting anything.

On Radeon RX 9070 XT (RADV, Vulkan 1.4.357) D24S8 advertises no VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, and vkGetImageFormatProperties fails for it with depth-stencil attachment plus transfer at both one and two samples. texture_cache_layered_image, texture_cache_image_views, texture_cache_storage_sampled, texture_cache_htile_clear and buffer_cache_ranges all ended at

image format does not support required usage: format=129 type=1 usage=0x23 flags=0x0 samples=1|2
 in src/graphics/host_gpu/renderer/image/image.cpp

This carries the two commits from #1811 (whose branch is 337 commits behind main, and whose only other commit, the ESRCH fix, is already in main) and fixes what they missed:

  • SupportedDepthStencilFormat resolves a host depth-stencil format against the device, preferring D24S8 and falling back to D32SfloatS8 then D16UnormS8, and the fixtures that build a depth-stencil target skip instead of exiting when nothing is available.
  • The probe now mirrors ImageUsageFlags exactly: the sampled bit (and with it the feedback-loop bit) only joins the mask when vkGetFormatProperties advertises sampled-image support for the candidate. Probing a larger mask rejected formats the constructor would have accepted; probing a smaller one admitted formats that still exit.
  • The D16 promotion check reads the host format the cache actually resolved and compares against EncodeD16AsD32 for a float fallback, instead of assuming the D24 encoding EncodeD16AsD24.

Five of the six entries pass after this change (UnifiedImageViewCache, CubeFaceStorageExpansion and UnifiedTextureCacheFlow all report ok), and the full suite goes from 73 to 78 of 82 on this machine. The four remaining failures are unrelated: shader_recompiler_compute (ResourcePlanHandoff), graphics_pipeline_rasterization (SEGFAULT in the all-skipped path), compute_meta_clear_classification (disjoint-sampling layouts) and texture_cache_image_overlap (SEGFAULT).

Built with clang-cl, Release, Ninja, Windows 11.

**@⁠theantipopau** on GitHub · 2026-11-04 23:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2118) `theantipopau:fix/depth-stencil-usage-mask` → `main` · +165 −41 · 1 files · 2 commits · open `Image::Image` does not degrade when the device refuses a format/usage/sample combination: it calls `EXIT`. The texture-cache fixtures hardcode `VK_FORMAT_D24_UNORM_S8_UINT`, so on a device that rejects it they abort before reporting anything. On Radeon RX 9070 XT (RADV, Vulkan 1.4.357) D24S8 advertises no `VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT`, and `vkGetImageFormatProperties` fails for it with depth-stencil attachment plus transfer at both one and two samples. `texture_cache_layered_image`, `texture_cache_image_views`, `texture_cache_storage_sampled`, `texture_cache_htile_clear` and `buffer_cache_ranges` all ended at ``` image format does not support required usage: format=129 type=1 usage=0x23 flags=0x0 samples=1|2 in src/graphics/host_gpu/renderer/image/image.cpp ``` This carries the two commits from #1811 (whose branch is 337 commits behind `main`, and whose only other commit, the `ESRCH` fix, is already in `main`) and fixes what they missed: * **`SupportedDepthStencilFormat`** resolves a host depth-stencil format against the device, preferring D24S8 and falling back to D32SfloatS8 then D16UnormS8, and the fixtures that build a depth-stencil target skip instead of exiting when nothing is available. * The probe now mirrors `ImageUsageFlags` exactly: the sampled bit (and with it the feedback-loop bit) only joins the mask when `vkGetFormatProperties` advertises sampled-image support for the candidate. Probing a larger mask rejected formats the constructor would have accepted; probing a smaller one admitted formats that still exit. * The D16 promotion check reads the host format the cache actually resolved and compares against `EncodeD16AsD32` for a float fallback, instead of assuming the D24 encoding `EncodeD16AsD24`. Five of the six entries pass after this change (`UnifiedImageViewCache`, `CubeFaceStorageExpansion` and `UnifiedTextureCacheFlow` all report `ok`), and the full suite goes from 73 to 78 of 82 on this machine. The four remaining failures are unrelated: `shader_recompiler_compute` (`ResourcePlanHandoff`), `graphics_pipeline_rasterization` (SEGFAULT in the all-skipped path), `compute_meta_clear_classification` (disjoint-sampling layouts) and `texture_cache_image_overlap` (SEGFAULT). Built with clang-cl, Release, Ninja, Windows 11.
Image::Image exits when the device refuses a format, usage and sample
combination, so hardcoding D24S8 makes the texture-cache fixtures abort on
drivers that reject it. Resolve the host depth-stencil format against the
device, probe exactly the usage mask ImageUsageFlags will request, and read the
resolved format back in the D16 promotion check instead of assuming D24.

Supersedes #1811, which is 337 commits behind main.
The harness skipped the rasterization cases only by printing a notice: the
pipeline was still created and the draw still issued, so a device without
fillModeNonSolid or the feedback-loop features died in the draw instead of
skipping it.

The sampled-depth checks also hardcoded the feedback-loop layout. A device
that does not enable attachment_feedback_loop_enabled cannot use that
layout; the renderer falls back to eGeneral for a depth attachment that is
sampled while it is written, so the expected layout now follows the enabled
feature.

Both were the last two failures on RADV, where attachmentFeedbackLoopLayout
is unavailable for the Radeon RX 9070 XT.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:14:53 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original · edited 2026-11-05 03:06 UTC

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Vulkan test harness selects depth-stencil formats based on image-format properties and sample-count support. Tests skip rasterization cases when no suitable format is available or rasterization is unsupported. Sampled-depth layout expectations depend on the enabled feature. The harness enables robust pipeline support only when the required extension, features, and alignment condition are available. Compute cases that require unavailable robust pipeline support are skipped and counted.

Suggested reviewers: nmzik, claxten10

Change: Other

Merge Risk: Moderate · up to 9bebd

The harness can leak resources or falsely fail on supported fallback devices; fix these issues before merging.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: probing depth-stencil formats with the renderer-requested usage.
Description check Passed The description is detailed and directly related to the changeset. It explains format probing, fallback behavior, skipped tests, layout handling, and reported test results.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 too large.)

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9e31081b2b and 9bebdd9eb2.

Files selected for processing: 1

  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-04 23:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2118#issuecomment-6644960692) · edited 2026-11-05 03:06 UTC <!-- 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/2118?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 --> <!-- recent_review_status_start --> No actionable comments were generated in the recent review. <!-- recent_review_status_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> The Vulkan test harness selects depth-stencil formats based on image-format properties and sample-count support. Tests skip rasterization cases when no suitable format is available or rasterization is unsupported. Sampled-depth layout expectations depend on the enabled feature. The harness enables robust pipeline support only when the required extension, features, and alignment condition are available. Compute cases that require unavailable robust pipeline support are skipped and counted. **Suggested reviewers:** `nmzik`, `claxten10` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"9bebdd9eb20769b62db8d40dd9ca0f070c528088" --> <!-- change_assessment_priority:{"version":1,"urgency":"p3","manual":false} --> **Change:** Other <!-- 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>9bebd</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `9bebd` --> <!-- final_review_risk_coverage:{"sourceCommitId":"9bebdd9eb20769b62db8d40dd9ca0f070c528088","coveredCommitId":"9bebdd9eb20769b62db8d40dd9ca0f070c528088","kind":"reviewed"} --> The harness can leak resources or falsely fail on supported fallback devices; fix these issues before merging. <!-- 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> 5</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 clearly and concisely describes the primary change: probing depth-stencil formats with the renderer-requested usage. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description is detailed and directly related to the changeset. It explains format probing, fallback behavior, skipped tests, layout handling, and reported test results. | | Docstring Coverage | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… | | 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: Docstring Coverage</strong></summary> <dl> <dd> <br> **Explanation** No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 too large.) </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=2118)! 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 --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><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</strong></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/4c890e90857bab980bd4654f7cb9ca9d7c31e6f5/.coderabbit.yaml>) - **Commit**: [4c890e9](<https://github.com/KytyPS5/KytyPS5/commit/4c890e90857bab980bd4654f7cb9ca9d7c31e6f5>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `f55382ae-783b-4594-919c-c75021a69bbe` </dd> </dl> </details> <details> <summary><strong><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</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 9e31081b2be0b15dc75a9f5d9c2a16447b049e65 and 9bebdd9eb20769b62db8d40dd9ca0f070c528088. </dd> </dl> </details> <details> <summary><strong><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</strong></summary> <dl> <dd> <br> * `tests/ShaderRecompilerComputeTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->
@ -7691,0 +7758,4 @@
vk::SampleCountFlagBits::e2);
if (ms_depth_format == vk::Format::eUndefined) {
SkipRasterizationCases(1);
return;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original

Major · Stability & Availability · Heavy lift

Keep the two-sample skip inside a cleanup-safe scope.

If no candidate supports two samples, this return bypasses the later checks in CheckUnifiedTextureCacheFlow. It also bypasses resources.UnmapMemory, scheduler.Finish, context.ShutdownGpu, and release of the mapped direct-memory allocation. Restrict the skip to the two-sample checks, then run the function’s normal cleanup. (raw.githubusercontent.com)

**@⁠coderabbitai[bot]** on GitHub · 2026-11-04 23:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2118#discussion_r4474625399) <!-- 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** · **Stability & Availability** · **Heavy lift** **Keep the two-sample skip inside a cleanup-safe scope.** If no candidate supports two samples, this `return` bypasses the later checks in `CheckUnifiedTextureCacheFlow`. It also bypasses `resources.UnmapMemory`, `scheduler.Finish`, `context.ShutdownGpu`, and release of the mapped direct-memory allocation. Restrict the skip to the two-sample checks, then run the function’s normal cleanup. ([raw.githubusercontent.com](https://raw.githubusercontent.com/KytyPS5/KytyPS5/9e31081b2be0b15dc75a9f5d9c2a16447b049e65/tests/ShaderRecompilerComputeTests.cpp)) <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:3b88f83c0a5eafcb6490c30a --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -10304,0 +10386,4 @@
EncodeD16AsD32(d16_fallback_values[i]);
} else {
d16_promoted &= (d16_restenciled_words[i] & 0x00ffffffu) ==
EncodeD16AsD24(d16_fallback_values[i]);
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

sed -n '10230,10400p' tests/ShaderRecompilerComputeTests.cpp

Repository: KytyPS5/KytyPS5

Length of output: 9832


Script executed:

# Test-side selector and its use in the D16 promotion path
rg -n -F -e 'SupportedDepthStencilFormat' -e 'eD16UnormS8Uint' -e 'eD24UnormS8Uint' -e 'eD32SfloatS8Uint' -- tests/ShaderRecompilerComputeTests.cpp || test "$?" -eq 1

# Cache-side host depth format selection for depth images that carry stencil
rg -n -F -e 'eD16UnormS8Uint' -e 'eD16Unorm' -e 'D16UnormS8' -- src/video_core/ || test "$?" -eq 1

# Outline likely texture cache files that handle depth host formats
rg -n -F -e 'FindDepthTarget' -e 'DepthStencil' -e 'd16' -e 'D16' --glob '*texture_cache*' -- src/video_core/ || test "$?" -eq 1

Repository: KytyPS5/KytyPS5

Length of output: 3689


Script executed:

# Selector body in the test harness
sed -n '2150,2180p' tests/ShaderRecompilerComputeTests.cpp

# Locate the texture cache sources without assuming src/video_core
fd -t f -i 'texture_cache' . | head -n 40

# Find the cache-side depth host format selection for D16 stencil images
rg -n -F -e 'eD16UnormS8Uint' -e 'D16UnormS8' -e 'eD16Unorm' -- . --glob '!tests/**' --glob '!build/**' || test "$?" -eq 1

Repository: KytyPS5/KytyPS5

Length of output: 10502


Script executed:

# Promotion table and its lookup
sed -n '160,250p' src/graphics/host_gpu/renderer/image/imageInfo.h

# Image host format consumer
sed -n '95,135p' src/graphics/host_gpu/renderer/image/image.cpp

Repository: KytyPS5/KytyPS5

Length of output: 4930


Script executed:

# Call sites of the stencil attachment selection
rg -n -F -e 'DepthAttachmentFormat(' -e 'FindDepthFormatPolicy(' -e 'FindGuestDepthFormatPolicy(' -- src/graphics/ || test "$?" -eq 1

Repository: KytyPS5/KytyPS5

Length of output: 1360


Script executed:

sed -n '100,200p' src/graphics/host_gpu/renderer/depthRenderTarget.cpp

Repository: KytyPS5/KytyPS5

Length of output: 5114


Compare D16S8 readbacks as 16-bit values.

When SupportedDepthStencilFormat falls back to eD16UnormS8Uint, the restenciled depth image uses D16S8. Its depth-aspect readback stores four 16-bit values in bytes 0-7. The current loop reads those bytes as 32-bit words and compares them with the D24 encoding, so the Require at line 10383 fails even when every depth value survives.

Suggested fix
       bool d16_promoted = d16_restenciled_image != d16_native_image;
+      std::array<uint16_t, 4> d16_restenciled_values{};
+      std::memcpy(d16_restenciled_values.data(), d16_restenciled_words.data(),
+                  sizeof(d16_restenciled_values));
       for (size_t i = 0; i < d16_fallback_values.size(); ++i) {
-        if (d16_promoted_to_float) {
+        if (d16_promoted_format == vk::Format::eD16UnormS8Uint) {
+          d16_promoted &= d16_restenciled_values[i] == d16_fallback_values[i];
+        } else if (d16_promoted_to_float) {
           d16_promoted &= d16_restenciled_words[i] ==
                           EncodeD16AsD32(d16_fallback_values[i]);
         } else {
**@⁠coderabbitai[bot]** on GitHub · 2026-11-04 23:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2118#discussion_r4474625411) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor** · **Functional Correctness** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash sed -n '10230,10400p' tests/ShaderRecompilerComputeTests.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 9832 --- Script executed: ```bash # Test-side selector and its use in the D16 promotion path rg -n -F -e 'SupportedDepthStencilFormat' -e 'eD16UnormS8Uint' -e 'eD24UnormS8Uint' -e 'eD32SfloatS8Uint' -- tests/ShaderRecompilerComputeTests.cpp || test "$?" -eq 1 # Cache-side host depth format selection for depth images that carry stencil rg -n -F -e 'eD16UnormS8Uint' -e 'eD16Unorm' -e 'D16UnormS8' -- src/video_core/ || test "$?" -eq 1 # Outline likely texture cache files that handle depth host formats rg -n -F -e 'FindDepthTarget' -e 'DepthStencil' -e 'd16' -e 'D16' --glob '*texture_cache*' -- src/video_core/ || test "$?" -eq 1 ``` Repository: KytyPS5/KytyPS5 Length of output: 3689 --- Script executed: ```bash # Selector body in the test harness sed -n '2150,2180p' tests/ShaderRecompilerComputeTests.cpp # Locate the texture cache sources without assuming src/video_core fd -t f -i 'texture_cache' . | head -n 40 # Find the cache-side depth host format selection for D16 stencil images rg -n -F -e 'eD16UnormS8Uint' -e 'D16UnormS8' -e 'eD16Unorm' -- . --glob '!tests/**' --glob '!build/**' || test "$?" -eq 1 ``` Repository: KytyPS5/KytyPS5 Length of output: 10502 --- Script executed: ```bash # Promotion table and its lookup sed -n '160,250p' src/graphics/host_gpu/renderer/image/imageInfo.h # Image host format consumer sed -n '95,135p' src/graphics/host_gpu/renderer/image/image.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 4930 --- Script executed: ```bash # Call sites of the stencil attachment selection rg -n -F -e 'DepthAttachmentFormat(' -e 'FindDepthFormatPolicy(' -e 'FindGuestDepthFormatPolicy(' -- src/graphics/ || test "$?" -eq 1 ``` Repository: KytyPS5/KytyPS5 Length of output: 1360 --- Script executed: ```bash sed -n '100,200p' src/graphics/host_gpu/renderer/depthRenderTarget.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 5114 --- </dd> </dl> </details> **Compare D16S8 readbacks as 16-bit values.** When `SupportedDepthStencilFormat` falls back to `eD16UnormS8Uint`, the restenciled depth image uses D16S8. Its depth-aspect readback stores four 16-bit values in bytes 0-7. The current loop reads those bytes as 32-bit words and compares them with the D24 encoding, so the `Require` at line 10383 fails even when every depth value survives. <details> <summary>Suggested fix</summary> <dl> <dd> ```diff bool d16_promoted = d16_restenciled_image != d16_native_image; + std::array<uint16_t, 4> d16_restenciled_values{}; + std::memcpy(d16_restenciled_values.data(), d16_restenciled_words.data(), + sizeof(d16_restenciled_values)); for (size_t i = 0; i < d16_fallback_values.size(); ++i) { - if (d16_promoted_to_float) { + if (d16_promoted_format == vk::Format::eD16UnormS8Uint) { + d16_promoted &= d16_restenciled_values[i] == d16_fallback_values[i]; + } else if (d16_promoted_to_float) { d16_promoted &= d16_restenciled_words[i] == EncodeD16AsD32(d16_fallback_values[i]); } else { ``` </dd> </dl> </details> <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:1a74638149ef4215313defd4 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original · reviewed

Actionable comments posted: 2

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4c890e9085 and 9e31081b2b.

Files selected for processing: 1
  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-04 23:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2118#pullrequestreview-5777408086) · **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> <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> - **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/4c890e90857bab980bd4654f7cb9ca9d7c31e6f5/.coderabbit.yaml>) - **Commit**: [4c890e9](<https://github.com/KytyPS5/KytyPS5/commit/4c890e90857bab980bd4654f7cb9ca9d7c31e6f5>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `6dfc5c47-904f-4322-abe1-629754ae632e` </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> Reviewing files that changed from the base of the PR and between 4c890e90857bab980bd4654f7cb9ca9d7c31e6f5 and 9e31081b2be0b15dc75a9f5d9c2a16447b049e65. </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> * `tests/ShaderRecompilerComputeTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=6c24b495-3c58-4076-ab9f-8569a45dcf17 attempt=18a83949-0047-460c-832e-d7acf3ea5b22 batch=1/1 -->
This pull request has changes conflicting with the target branch.
  • tests/ShaderRecompilerComputeTests.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2118/head:github-bot/gh-2118'
git switch 'github-bot/gh-2118'

Merge

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