Repository navigation
fix(agc): sample 1_5_5_5 textures through A1R5G5B5 - #23360
oneandonlydean merged 2 commits into
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.
|
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
Changes are required before merge: clarify that validation and device test results are author-reported; this review did not run them.
What I ran
Reviewed head 224fb9d8335f48c7a6cccb616bafc8d089513767. Read the prepared description, commits, manifest, diff, and the included changed files; used repo_read.py to inspect the excluded Texture.cpp and related source callers. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Relevant code and callers inspected |
| Tests and validation | not run | Results in the description are author-reported |
Findings
Blocking
None.
Non-blocking
description.mdpresents extensive multi-device test and validation-layer results under Tested without clearly labeling them as author-reported. Since those runs were not performed in this review, identify them as author-reported results to distinguish them from reviewer checks.
Not verified
No tests, builds, or validation-layer runs were performed. Texture.cpp and Recorder.cpp were excluded from the prepared full-text files and were read only in targeted ranges through repo_read.py; the remaining changed files listed in the manifest as included were read. Hardware behavior and the author-reported results were not independently verified.
To get this to a good state
Nothing is required. The labeling suggestion above is optional.
|
Thanks. The Tested section now says these are my own runs on one machine; the GPU checks posted on this PR by others are theirs. |
|
Windows + NVIDIA run of head Setup: Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 3070 Ti (Ampere), driver 610.88 (Vulkan 1.4.341), WinLibs GCC 15.2.0 r7, Release, Format support on this device (optimal tiling,
So the Focused tests: the 16 tests listed in the description (15 on
Not covered: the whole suite, and no title was run. AI-assisted: yes (Claude Code). I ran the tests; this summary was written from their logs. |
|
The failing
Nothing in this PR needs to change. A collaborator only needs to start the Windows build again. AI-assisted: yes (Claude Code). |
|
I tested the pre-dispatch barrier on Windows 11 with an RTX 5090 Laptop (621.01) and Intel Graphics (101.8860). The production shader and dispatch at head 224fb9d, applied to 34bd032, matched an independent bit-field check in 18/18 runs across the two GPUs. The probe included every 16-bit input and adjacent in-place ranges sharing a word. Removing only the barrier made the boundary probe fail in 18/18 runs. The existing rotated-repack test still passed 6/6 with the barrier removed, and six synchronization-validation runs on that control logged no SYNC-HAZARD. Could the recorder test include consecutive dispatches that update adjacent halves of one destination word in the same command buffer? That would cover the dependency the patch fixes. I ran the focused test commands directly. The full recorder passed on NVIDIA on both revisions; on Intel both stopped at the existing unchanged-draw-input assertion before reaching this test. No title was run. AI-assisted: yes. |
|
@u-instinct11 thanks for the Windows runs and for isolating the barrier, you were right that nothing covered it. 65d0793 adds the case you describe to
The description's Tested section has the same numbers. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing in the inspected changed code shows a verified blocking defect; the author reports passing targeted and broader checks, which I did not run.
What I ran
- Read the prepared diff and commit description for head
65d079335b15e4c8dc10a5d8df9058a7452b57c9. - Read changed source ranges in
Texture.hpp,TextureDetiler.hpp,TextureFormat.hpp,TextureRepack.comp,Texture.cpp,TextureDetiler.cpp, andTextureFormat.cpp; read changed test ranges inRecorder.cppandTextureFormat.cpp, the recorder CMake registration, and the new debt note. - No build, test, or validation command was run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | No verified blocking defect found |
| Build and tests | not run | Results in the PR description are author reported |
| Full changed-file review | not run | Two changed files were excluded from the prepared full-text bundle |
Findings
Blocking
None.
Non-blocking
None.
Not verified
- I did not run the reported test suite or Vulkan validation checks.
- I did not read all of
Texture.cpporRecorder.cpp; only the changed hunks and relevant caller ranges were inspected. The prepared manifest marks these files as excluded because they are too large for the review folder. - I did not verify device behavior, the author’s test environment, or claims in the PR description against external sources.
- Other changed files listed in the manifest were inspected at their changed ranges; the prepared
review/filesdirectory contained no files.
To get this to a good state
Nothing is required. The points above are limitations of this review, not requested changes.
|
Thanks for adding the adjacent-range case, @GiannisG1. I reran the updated recorder test on the two Windows GPUs from my earlier report. With the barrier present it passed 3/3 on Intel Graphics (101.8860) and 3/3 on the RTX 5090 Laptop (621.01). Removing just the barrier failed 3/3 on each: Intel left texel 4 as 50245 (expected 57890), and NVIDIA left texel 5 as 54614 (expected 27307). I applied the test diff from 65d0793 to the same 34bd032 + PR build used for the earlier comparison, rebuilt the recorder executable, and ran it directly with --rotated-repack-only. Both driver binaries matched the hashes from that comparison. The Khronos validation layer loaded in all 12 runs with no VUID messages. The new test catches the missing barrier on both adapters here. AI-assisted: yes. |
|
Verdict: on an AMD R9700 under Windows, the five focused GPU tests and the CPU format test pass on Code. I read the diff at
Overlap with #24218. Both PRs edit Existing runs.
None used AMD's Windows driver. Negative control. On the merge I removed
I then reverted the change. Probe. On the merge I removed the barrier at
The validation layer reported nothing, because synchronization validation is not enabled by this environment. This matches u-instinct11's result on NVIDIA and Intel. I then reverted the change. GPU. Command, for main and for each head run:
Validation. Every head and control log shows the loader inserting Speed evidence. None in the PR, and none is claimed. I did not measure speed.
AI-assisted: yes |
Guest format 135 was sampled as R5G5B5A1_UNORM_PACK16, which Vulkan leaves optional; the HD Graphics 630 (Mesa ANV) lists no features for it, so its images were created, uploaded and copied in an unsupported format. Rotate each texel right by one bit into the mandatory A1R5G5B5_UNORM_PACK16 on upload and in copies from storage images, the repacked-copy path of format 43, and keep the storage image in its R16_UINT form where the host cannot sample and copy R5G5B5A1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e a word The rotated-repack test recorded one repack per command buffer, so it passed with the barrier DispatchRepack records before a partial-word read-modify-write removed. Record 64 pairs of repacks in one command buffer whose ranges meet inside one destination word and check every texel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65d0793 to
e4cb9dd
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The inspected changes and author-reported results support merging; no blocking defect was verified.
What I ran
Reviewed head e4cb9ddab3d20e7dabdac14e315cb7df00640e22 using the prepared diff and pinned repository reader. No test or build commands were run in this review environment; the test results in the description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Changed-line review | passed | All 11 changed files reviewed |
| Build and tests | not run | Results reported by the author only |
| Negative control | not run | Not independently repeated |
Negative control
No negative control was run during this review. The description reports tests failing with the relevant changes removed; that result was not independently verified.
Findings
Blocking
None.
Non-blocking
None.
Sources
- Texture repack dispatch at the reviewed head
- Format selection and rotation at the reviewed head
- Texture upload and storage-image copy paths at the reviewed head
Not verified
Builds, tests, validation-layer runs, GPU behavior, and the author-reported results were not independently verified. All changed lines were reviewed across 11 files. Texture.cpp and Recorder.cpp were excluded from the prepared folder due to size; their changed ranges were read through the pinned repository reader.
To get this to a good state
Nothing is required.
What
Guest format 135 (
Format1_5_5_5UNorm: X/Y/Z/W at bits 0/1/6/11, widths 1/5/5/5, #14628) is sampled and stored throughVK_FORMAT_R5G5B5A1_UNORM_PACK16. Vulkan requires no feature for that format (Mandatory Format Support: Sub-Byte Components lists it, likeB5G5R5A1, with no mandatory feature), and some devices have none:R5G5B5A1_UNORM_PACK16A1R5G5B5_UNORM_PACK16On the HD 630, textures and storage images of 135 are still created, uploaded, copied and filtered in
R5G5B5A1.agc_driver_image_packed16_loadandagc_driver_image_packed16_storage_135pass only by luck there; the validation layer reportsVUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251,VUID-VkImageViewCreateInfo-None-02273,VUID-vkCmdCopyBufferToImage-dstImage-01997,VUID-vkCmdCopyImageToBuffer-srcImage-01998andVUID-vkCmdDispatch-magFilter-04553.A1R5G5B5_UNORM_PACK16, which every Vulkan device must sample, filter and copy (same table). Rotating each 16-bit texel right by one bit moves X/Y/Z/W from bits 0/1/6/11 to 15/0/5/10, which are A/B/G/R ofA1R5G5B5, so the existing A/B/G/R selectors of 135 stay. The rotation runs on the paths format 43 already uses for itsB10G11R11repack: after the detile on upload, and in the copy from a storage image (CanRepackCopyFrom,RefreshDepthCopy).TextureRepack.compgets a third mode next to 10_11_11 and depth-to-float, selected byTextureRepackFor. It runs on every device, so lavapipe on CI exercises the same path as the HD 630.DispatchRepacktakes 2-byte-aligned ranges. A word the range shares with its neighbour is rewritten only in the range's own half, after a barrier that orders it after earlier repacks. The linear buffers are rounded up to whole words.R16_UINTviews. The image itself is now created asR16_UINTwhere the device cannot sample and copyR5G5B5A1(StorageFormatOrUndefined), and staysR5G5B5A1elsewhere. Sampled 135 textures never view the storage image directly; they take the repacked copy.ResolveTextureFormatand the DCC clear texels keep 135's guest layout (R5G5B5A1). A fast-cleared 135 texture is filled on the CPU and uploaded through the rotation, as format 43 already is.fix-agc-sample-135-through-a1r5g5b5.md).Tested
All runs below are mine, on one machine: Linux Mint 22.3, GCC 13.3.0, Release, head on
main866864a5bc.tests/TextureFormat.cpp(agc_driver_graphics): 135 is repacked with the rotation and sampled asA1R5G5B5(43 keeps its 10_11_11 repack);ResolveTextureFormatandDccClearTextureFormatkeepR5G5B5A1. All 65536 texel values, each paired with a neighbour in one word, rotate so that the A/B/G/R selectors read X/Y/Z/W. A mock device withoutR5G5B5A1features keeps 1_5_5_5 storage images asR16_UINT; one with them keepsR5G5B5A1.tests/Recorder.cpp, newagc_recorder_rotated_repack: the repack shader rotates all 65536 texel values exactly asRotateTextureWorddoes. A range of texels 3 to 7 rotates only those, with both of its boundary words shared. A 5x3 1_5_5_5 storage image with two levels (30 and 4 bytes, the second starting in the middle of a word) is served through the repacked copy and reads every component correctly at both levels. Since 65d0793 (asked for by u-instinct11), 64 pairs of repacks in one command buffer whose ranges meet inside one destination word must leave every texel rotated or untouched, which needs the compute-to-compute barrierDispatchRepackrecords before a partial-word read-modify-write.DispatchRepacktaking only whole words,agc_driver_graphicsfails withtexture format 135 must be sampled through a rotated copyandagc_recorder_rotated_repackwitha texel repack needs whole aligned words. Without theR16_UINTstorage fallback,agc_driver_graphicsfails witha device that cannot copy R5G5B5A1_UNORM must keep 1_5_5_5 storage images in their R16_UINT form. Each failed in 3 of 3 runs on the GTX. With only that barrier removed, the adjacent-halves case fails 5 of 5 runs on the GTX (left texel 4 as 50245, expected 57890) and 5 of 5 on the HD 630 (texel 4 or 5). llvmpipe runs the dispatches one after another and passes 5 of 5. With the barrier, it passes 3 of 3 on each, with no validation-layer (SDK 1.4.363.1) messages.check_skips.pyis clean:agc_driver_graphics,agc_recorder_rotated_repack,agc_recorder_cube, the fiveagc_driver_image_packed16_*,agc_driver_image_repacked_float,agc_driver_own_refresh_repack_alias,agc_driver_recover_repack_allocation,agc_driver_image_depth24,agc_driver_image_depth24_float(the depth-to-float repack mode),agc_driver_image_load_packed,agc_driver_image_store_packed,agc_driver_image_packed_horizontal_gather.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V -j1on the same tests (15 onmain, which lacks the new one),main866864a5bcand this PR, on all four devices. Everything passes on both sides. The loader inserts the layer in every test that opens a device (all butagc_driver_graphics, which uses mock devices) and never reports it as not found. Onmain, the GTX, llvmpipe and lavapipe report nothing; the HD 630 reports 82 messages, all five VUIDs above, inagc_driver_image_packed16_load(36) andagc_driver_image_packed16_storage_135(46). With this PR, all four devices report nothing.tools/suite.py: every test once, GPU tests on all three devices) on this PR, compared withmain866864a5bc's own run on the same machine. Nothing fails with the PR that does not fail onmain. GTX: 6164 run, 2 failed,guest_libressl3_aesandguest_libressl3_aes_wrap(fix(libSceLibreSsl3): reject oversized lengths in AES_wrap_key and AES_unwrap_key #23208's length bound against the older tests; test(libSceLibreSsl3): probe unreadable key-wrap input at an accepted length #23337 and fix(libSceLibreSsl3): drop the INT_MAX length bound from AES_wrap_key and AES_unwrap_key #23334 are open). HD 630: 1687 run, 10 failed, all failing onmaintoo (mainalso hadagc_driver_pm4_order_signal). llvmpipe: 1687 run, the same 8 failed as onmain.agc_driver_recorder, whose full run now includes the new test, stops on HD 630 and llvmpipe on both sides atan unchanged draw input was copied again(test(agc): skip the draw input mirror cases on devices whose memory is all device-local #20831), before reaching it; on the GTX it passes.check_conventions.py,check_test_registration.py,check_main_sync.py(merges cleanly),check_compile.pyandgit diff --checkare clean.pr_overlap.py --branchnames feat(libSceAgcDriver): sample guest X24_8_32_FLOAT images through D32_SFLOAT_S8_UINT #16427, which also turnsTextureRepack.comp'sdepthToFloatpush constant into amodeand uses 2 for its X24_8_32 extract, and fix(agc): refuse 10_10_10_2 signed and 4_4 textures the device cannot sample #22717, which changes the twoSampledTextureFormatlines next to the ones changed here. Whichever lands second renumbers its mode or takes the other's lines; I'll rebase this one if it is second. Of the 39 PRs it could not compare (they conflict withmain), none changes the lines changed here. feat(agc): look up table images at run time through a device image table on the GPU heap (APS5_GPU_PATH) #7642, feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508, feat(agc): serve lane-keyed, pointer and runtime image-table columns #10193, feat(agc): resolve table samplers through device image keys #13928 and feat(agc): resolve runtime sampler addresses through device image keys #13929 add an addressed variant of the same shader's push block, and feat(agc): read frame capture deltas with the title's work in flight #15136 edits the same Windowsset_tests_propertiesline.Update 2026-11-26 (head
e4cb9ddab3): rebased ontomaine09d1349b5, after #22717. The one conflict was inSampledTextureFormat(): #22717'sOptionalSampledBitcheck is kept, followed by this PR's explicit 10_11_11/11_11_10 →B10G11R11and 1_5_5_5 →A1R5G5B5lines. The oldIsRepackedTextureFormatform is dropped, because with this PR it would also cover format 135.On this head:
mainlogs 82 messages in that set on the HD 630, all from format 135:VUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251,VUID-VkImageViewCreateInfo-None-02273,VUID-vkCmdCopyBufferToImage-dstImage-01997,VUID-vkCmdCopyImageToBuffer-srcImage-01998andVUID-vkCmdDispatch-magFilter-04553. This branch logs none. The other devices log none on either side.maind237f5d065run, except for two tests added tomainsince then. They fail the same way on unmodifiedmaine09d1349b5(3 runs):agc_driver_float64_transcendental_denormalson the HD 630 (v_rsq_f64of0x…01);agc_driver_image_filter_mode_threeon llvmpipe (format 37 through a min/max reduction sampler).Merge order with #16427: if it lands first, both PRs extend
DispatchRepack(this PR'sTextureRepackenum, itsmode0/1/2), so the rebase has to fold its modes into the enum.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