tests: probe the depth-stencil format with the usage the renderer requests #2118
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!2118
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2118"
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-11-04 23:18 UTC · original
theantipopau:fix/depth-stencil-usage-mask→main· +165 −41 · 1 files · 2 commits · openImage::Imagedoes not degrade when the device refuses a format/usage/sample combination: it callsEXIT. The texture-cache fixtures hardcodeVK_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, andvkGetImageFormatPropertiesfails 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_clearandbuffer_cache_rangesall ended atThis carries the two commits from #1811 (whose branch is 337 commits behind
main, and whose only other commit, theESRCHfix, is already inmain) and fixes what they missed:SupportedDepthStencilFormatresolves 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.ImageUsageFlagsexactly: the sampled bit (and with it the feedback-loop bit) only joins the mask whenvkGetFormatPropertiesadvertises 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.EncodeD16AsD32for a float fallback, instead of assuming the D24 encodingEncodeD16AsD24.Five of the six entries pass after this change (
UnifiedImageViewCache,CubeFaceStorageExpansionandUnifiedTextureCacheFlowall reportok), 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) andtexture_cache_image_overlap(SEGFAULT).Built with clang-cl, Release, Ninja, Windows 11.
@coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original · edited 2026-11-05 03:06 UTC
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,claxten10Change: Other
Merge Risk:
Moderate · up to
9bebdThe harness can leak resources or falsely fail on supported fallback devices; fix these issues before merging.
Pre-merge checks:
5
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
f55382ae-783b-4594-919c-c75021a69bbeReviewing files that changed from the base of the PR and between
9e31081b2band9bebdd9eb2.tests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@ -7691,0 +7758,4 @@vk::SampleCountFlagBits::e2);if (ms_depth_format == vk::Format::eUndefined) {SkipRasterizationCases(1);return;@coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original
Keep the two-sample skip inside a cleanup-safe scope.
If no candidate supports two samples, this
returnbypasses the later checks inCheckUnifiedTextureCacheFlow. It also bypassesresources.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)@ -10304,0 +10386,4 @@EncodeD16AsD32(d16_fallback_values[i]);} else {d16_promoted &= (d16_restenciled_words[i] & 0x00ffffffu) ==EncodeD16AsD24(d16_fallback_values[i]);@coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9832
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 3689
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 10502
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 4930
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 1360
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5114
Compare D16S8 readbacks as 16-bit values.
When
SupportedDepthStencilFormatfalls back toeD16UnormS8Uint, 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 theRequireat line 10383 fails even when every depth value survives.Suggested fix
@coderabbitai[bot] on GitHub · 2026-11-04 23:24 UTC · original · reviewed
Actionable comments posted: 2
6dfc5c47-904f-4322-abe1-629754ae632eReviewing files that changed from the base of the PR and between
4c890e9085and9e31081b2b.tests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
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.Merge
Merge the changes and update on Forgejo.