Repository navigation
fix(agc): refuse 10_10_10_2 signed and 4_4 textures the device cannot sample - #22717
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Data from Linux on three more drivers. Optimal-tiling features from
137 is the same case as 51 and 55: #16253 says hosts without 72-74 have no sampled feature on the Pascal card either. That needs someone to look at whether anything samples them before they join the list. One more note: uploads copy into these images with (5_5_5_1, format 135 → |
1905914 to
d7cde3c
Compare
|
Thanks, that covers 137 and the |
|
Thanks, that table is very useful. I've pushed d7cde3c (rebased on main): optional formats now need both |
|
@MichonGoddijn231849 one question on d7cde3c: the new Require in SampledTextureFormat runs before the IsRepackedTextureFormat early return. Is guest format 137 (4_4) ever repacked or given a fallback on hosts without R4G4? If it is, a 4_4 texture that works today on those hosts would now throw. Please confirm it is not, or move the check after the repack path. Windows is still running on this head; I will review again once it is green. |
|
@oneandonlydean since 137 was my suggestion: on |
|
@oneandonlydean confirmed, 137 has no repack or fallback path. |
|
@oneandonlydean the red Windows run on d7cde3c (run 44404476899) is not from this change. The only failures are |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The reviewed code guards sampled texture formats 51, 55, and 137 against missing optimal tiling support for both sampled images and transfer destinations; tests and hardware checks were not run in this review.
What I ran
Reviewed head d7cde3ca36502f4b46883062c06e525f16da37ec using repo_read.py to read the prepared description, commits, manifest and diff, and changed-file ranges. No build or test commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All changed files read |
| Build and tests | not run | No execution environment available |
| Negative control | not run | Requires running the test suite |
Negative control
Not run; the test suite was not executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
The optional format feature checks and sampled-format rejection are in TextureFormat.cpp at the reviewed head.
Not verified
Build and test results, including the hardware and validation-layer results described by the author, were not independently verified. All six changed files listed in the manifest were read; VulkanDevice.cpp was read at its three changed ranges because its full text was excluded by size. No changed files were excluded from review.
To get this to a good state
Nothing is required. The build and test suite can be run for additional verification.
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
… sample Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 4_4 textures Optional sampled formats now also need VK_FORMAT_FEATURE_TRANSFER_DST_BIT, since texture uploads copy into the image, and guest format 137 (4_4, R4G4_UNORM_PACK8) joins the list, so a device that lists no features for it refuses the texture instead of creating an image it cannot use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d7cde3c to
2027f7f
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the review found no verified defect in the inspected code.
What I ran
Reviewed head 2027f7f1f5adeb4979d139210f53edae13040f8a. I read the prepared description, commits, manifest and diff, then used repo_read.py to inspect the changed files and the texture construction caller. No build or test commands were run; test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Diff and description | passed | Claims match inspected changes |
| Targeted source review | passed | Capability flow and resolver inspected |
| Build and tests | not run | PR reports hardware test results |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full VulkanDevice.cpp was excluded from the review bundle; only the three changed ranges were read through repo_read.py. The prepared manifest lists five changed files, all marked included except that file. I read the full text of the four included files and the three changed ranges of VulkanDevice.cpp. Build/test results and physical GPU behavior were not independently verified.
To get this to a good state
Nothing is required.
|
Reproduced on On the later emulated path your debt entry mentions: I measured 51 and 55 on gfx1036 hardware. Loads match signed 10-bit X/Y/Z with c/511 (−512 → −1.0) and a signed 2-bit W, bit-exact, as you describe. Stores round to nearest even in the 10-bit fields, but the 2-bit W rounds ±0.5 away from zero (→ ±1). #17623's R32_UINT conversion already decodes exactly this way for the other signed packed formats (details in #17623 (comment)). So 51/55 can move from this refusal to that conversion on devices your AI-assisted: yes (Claude Code) |
What
Guest formats 51 (
10_10_10_2_SNORM) and 55 (10_10_10_2_SINT) resolve toVK_FORMAT_A2B10G10R10_SNORM_PACK32andVK_FORMAT_A2B10G10R10_SINT_PACK32, which are optional Vulkan formats. Nothing checked that the device supports them, so AnyPS5 created sampled images in a format the device reports no features for:image_loadof such a texture returned(0, 0, 0, 1), whatever the texels;0xc0000094) insidenvoglv64.dll, called fromlibSceAgcDriver.prx.Neither device reports any linear or optimal tiling feature for either format (
vulkaninfo). This is the same situation the scaled formats were in, and they already throwunsupported guest texture formatthroughscaledSampledFormats. This PR adds the same guard for 51 and 55 so they fail loudly instead.TextureFormat.cpp:OptionalSampledFormatsrecords which of 51 and 55 the device can sample with optimal tiling, andSampledTextureFormatrefuses the others withunsupported guest texture format <n>. It is a separate list rather than an extension ofkScaledTextureFormats, which feat(agc): sample unsigned scaled textures through UNORM views #16260 rewrites.Context.hpp,VulkanDevice.cpp:optionalSampledFormatsis filled at device creation next toscaledSampledFormatsand copied into the context.optionalFormatTestsintests/TextureFormat.cpp(run byagc_driver_graphics) checks three things:libSceAgcDriver.md(fragmentdocs/dev/debt/changes/fix-refuse-unsupported-10-10-10-2-signed.md) states the throw and records how gfx1036 hardware decodes both formats, for a later emulated path: signed 10-bit X/Y/Z (SNORM c/511, -512 gives -1.0) and a signed 2-bit W.Update (rebased on current
main): following GiannisG1's Linuxvulkaninfodata below, an optional format now needs bothSAMPLED_IMAGEandTRANSFER_DSTin optimal tiling (uploads copy into the image withvkCmdCopyBufferToImage), and guest format 137 (4_4,R4G4_UNORM_PACK8) joins the list, so Mesa ANV and llvmpipe/lavapipe, which list no features for R4G4, refuse 4_4 textures instead of creating an unusable image. The 32_32_32 formats are left out until someone checks what samples them.tests/TextureFormat.cppnow also checks that 137 samples natively with both features, and that it and 51/55 are refused with onlySAMPLED_IMAGEor with no features.agc_driver_graphics,agc_driver_image_packed16_loadandagc_driver_image_pck_npass on the RTX 5080 and gfx1036 under the validation layer, with noVUID-messages; both devices report both features for R4G4.Tested
Windows 11 Pro 10.0:
tools/hw-oraclewith thevulkanruntime andagc_oracle_runner,image_loadof a 2D format-55 and format-51 T#. Onmain: AMD returns(0, 0, 0, 1)for every texel; NVIDIA crashes as described. With this change both devices reportAGC graphics: unsupported guest texture format 55and... 51.image_loadon gfx1036 over eight texels covering each field's extremes.ctest --test-dir build -R '^(agc_driver_graphics|agc_driver_emulated_color_compare)$' -VwithANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer, validation layer 1.4.363, once per GPU:VUID-; each log showsInsert instance layer "VK_LAYER_KHRONOS_validation"and nowas not found but was requested;agc_driver_emulated_color_comparealready skips format 51 on devices without the format, which both of these are, and is unchanged.pr_overlap.py --branchfailed closed on 40 open PRs that conflict withmainand shareVulkanDevice.cpporContext.hpp. I checked each diff: none touchesscaledSampledFormats,optionalSampledFormatsor the two A2B10G10R10 signed formats.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code