tests: resolve the host depth-stencil format against device support #1811
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!1811
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1811/head"
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?
@theantipopau on GitHub · 2026-10-22 03:23 UTC · original
theantipopau:depth-stencil-device-format→main· +82 −28 · 1 files · 2 commits · closed without mergingContinuation of #930, which GitHub refuses to reopen after the branch was rebased (the reopen call returns
reopenPullRequest: Could not open the pull request). Same change, rebased ontomainat7b7f9a70.Problem
Four fixtures build depth-stencil images with
vk::Format::eD24UnormS8Uinthardcoded. RADV on GFX1200 does not support that format for depth-stencil attachment + sampled + transfer usage, andImage::Imageexits the process (image format does not support required usage,src/graphics/host_gpu/renderer/image/image.cpp) instead of failing the case. On that device the suite therefore aborts rather than reporting a result.Reported with retest data by @MuteRex in #930:
mainran 12 failed / 57 cases on an RX 9060 XT; with this change 6 of those pass and the D24S8 aborts are gone.Change
VulkanHarness::SupportedDepthStencilFormatprobes the device withvkGetImageFormatPropertiesusing the exact usage the fixtures need, preferring D24S8, then D32S8, then D16S8, and returnseUndefinedif none is usable.SkipRasterizationCasespath rather than aborting the run.Test-only; no emulator behavior changes.
Verification
mainat7b7f9a70and touches onlytests/ShaderRecompilerComputeTests.cpp.CheckUnifiedImageViewCache, and twice inCheckUnifiedTextureCacheFlow); the API andSkipRasterizationCasessignatures match currentmain.@coderabbitai[bot] on GitHub · 2026-10-22 03:30 UTC · original · edited 2026-11-04 23:18 UTC
No actionable comments were generated in the recent review.
Walkthrough
The test harness now selects a depth-stencil format that supports the required image usage and sample count. The depth-stencil view and texture-cache tests use the selected format. When no suitable format is available, affected test cases record a skip.
Change: Bug fix
Merge Risk:
Low · previous review
4cd30On devices without a supported two-sample depth format, the test reports a skip but omits other checks that could still run. The change is mergeable with that test-coverage limitation understood.
Pre-merge checks:
5
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. 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
ab3eb37a-2093-4e9f-bc87-e14f9bf7bc0e📥 Commits
Reviewing files that changed from the base of the PR and between
652e794096and4cd3077b32.📒 Files selected for processing: 1
tests/ShaderRecompilerComputeTests.cpp🚧 Files skipped from review as they are similar to previous changes: 1
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
@ -2045,0 +2064,4 @@vk::ImageFormatProperties properties {};if (m_runtime_context.GetImageFormatProperties(candidate, vk::ImageType::e2D, vk::ImageTiling::eOptimal, usage,{}, &properties) == vk::Result::eSuccess &&@coderabbitai[bot] on GitHub · 2026-10-22 03:30 UTC · original · edited 2026-10-22 03:47 UTC
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 22235
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 36474
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 24492
Probe the feedback-loop usage bit.
Image::ImageaddseAttachmentFeedbackLoopEXTfor sampled depth images whenattachment_feedback_loop_enabledis true. The test sets this field fromm_rasterization_supported, butSupportedDepthStencilFormatomits the bit. A format can pass the helper query and fail the constructor query, which callsEXITinstead of skipping the case. Add the same usage bit to the probe.Suggested fix
✅ Addressed in commit
4cd3077@ -6811,3 +6865,3 @@ms_depth_desc.info.samples = 2;ms_depth_desc.info.type = Prospero::ImageType::kColor2D;ms_depth_desc.view_info.format = vk::Format::eD24UnormS8Uint;ms_depth_desc.view_info.format = ms_depth_format;@coderabbitai[bot] on GitHub · 2026-10-22 03:30 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5966
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 20937
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 41988
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 14965
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 17432
Do not return from the entire cache-flow test.
When no 2x format is supported,
SkipRasterizationCases(1)records only the 2x case, butreturnexitsCheckUnifiedTextureCacheFlow. This prevents the independentfour-sample depth overlapcheck and later cache checks from running. Guard the 2x-dependent checks instead, then continue with the later cases and record each separately skipped case.@coderabbitai[bot] on GitHub · 2026-10-22 03:30 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
9a23782b-c892-4164-983f-28efa3128c5f📥 Commits
Reviewing files that changed from the base of the PR and between
d7c1896647and652e794096.📒 Files selected for processing: 1
tests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@theantipopau on GitHub · 2026-10-22 03:46 UTC · original
Both CodeRabbit findings:
Feedback-loop usage bit — fixed in
4cd3077b.ImageUsageFlagsaddseAttachmentFeedbackLoopEXTfor a sampled depth image when the device enables the feature, so the probe now asks for the same usage. Without it a format could pass the probe and stillEXITinsideImage::Image.Early return from
CheckUnifiedTextureCacheFlow— leaving this as is for now, because the 2x depth image is not confined to a block I can guard. The fixture continues to usems_depth_image/ms_depth_modulewell past the four-sample check (the observer pipeline near the end is built from that module and destroyed at the end of the function), so a guard would have to wrap nearly the whole remaining fixture, not the ~90 lines that create it. TheSkipRasterizationCases(1)+ return is the same shape the other device-feature fixtures in this harness use, and it records one skipped case rather than aborting the run. Splitting the fixture so the four-sample and fault-boundary checks run independently of the 2x depth target is worth doing, but as its own change.@MuteRex on GitHub · 2026-10-22 15:59 UTC · original
Retested #1811 (
4cd3077) on AMD RDNA4 as requested. Confirmed: the six D24S8 aborts are gone.Hardware: RX 9060 XT (RADV GFX1200), Mesa 26.0.8, Ubuntu 26.04, kernel 7.0.0-38
Both builds are
kyty_emulator+kyty_tests, Release, Clang, no Qt. The base is the PR's own parent commit, so the only difference between them is this PR.7b7f9a77b7f9a7+ #1811 (4cd3077)On the base build,
texture_cache_layered_image,texture_cache_image_views,texture_cache_storage_sampled,texture_cache_image_overlap,texture_cache_htile_clearandbuffer_cache_rangesall fail withimage format does not support required usage: format=129 type=1 usage=0x23. With #1811 all six pass, andformat=129no longer appears anywhere in the log.The two remaining failures are the same in both builds and unrelated to this PR:
shader_recompiler_compute:BoundedRecordBufferAccess32gpu_tiler:GpuTilerCpuParitymismatch atdetile bytes family=4 bpe=1(the one #795 addressed)The 4 emulator CLI tests that showed "Not Run" last time now pass, because I built
kyty_emulatorthis time.Logs for both runs are attached.
AI assistance (Claude) was used to build both versions, run the suites and summarise the logs. I ran the tests on my own hardware and reviewed the results.
kytyps5-pr1811-tests.zip
@theantipopau on GitHub · 2026-11-04 22:36 UTC · original
Rebased onto
91c5820cand checked this on Windows (clang-cl, Release, Vulkan 1.4.357, Radeon RX 9070 XT). The three patched fixtures do use the probe, but these entries still abort before reporting a result:texture_cache_layered_image,texture_cache_image_views,texture_cache_storage_sampled,texture_cache_htile_clear,buffer_cache_ranges(andtexture_cache_image_overlapsegfaults instead).All of them end in
format=129isVK_FORMAT_D24_UNORM_S8_UINTandusage=0x23is depth-stencil attachment plus transfer source and destination — note there is no sampled bit.SupportedDepthStencilFormatprobes depth-stencil attachment + sampled + transfer, so it never covers the usage these fixtures actually request, and they build a two-sample D24S8 image through a path this PR does not touch. They would need the same probe (or a skip) with the unit's real usage mask.@theantipopau on GitHub · 2026-11-04 23:19 UTC · original
Superseded by #2118, which carries the two commits here onto current
mainand fixes what they missed.The probe in this PR asks for
DepthStencilAttachment | Sampled | TransferSrc | TransferDst, butImageUsageFlagsonly adds the sampled bit (and with it the feedback-loop bit) whenvkGetFormatPropertiesadvertises sampled-image support, so on a device that rejects D24S8 the probe could pass for a format the constructor then could not create — and the two-sample target and the D16 promotion check were still hardcoded. #2118 mirrors the exact mask, resolves the format at the sample count each fixture uses, and derives the D16 promotion encoding from the resolved host format. Verified on Radeon RX 9070 XT: five of the six texture-cache entries now pass and the suite goes 73 -> 78 of 82.Pull request closed