Repository navigation
Conversation
…rgets Measured on RDNA2 (gfx1036 under RADV, COLOR_11_11_10, RB+ off, 32_ABGR exports), the CB truncates an 11_11_10 float export toward zero whether CB_COLOR_INFO.ROUND_MODE is set or clear, and writes 0x3f0 or 0x7e0 for every NaN whatever its payload. ROUND_MODE 0 targets are no longer refused, and the packed export writes those NaN fields instead of the payload's top bits.
…E set Measured on RDNA2 (gfx1036 under RADV, RB+ off, 32_ABGR exports), the CB truncates an export into a 4_4_4_4 UNORM target with CB_COLOR_INFO.ROUND_MODE set to floor(clamp(v, 0, 1) * 15), NaN to 0, and rounds to nearest with the bit clear. Such a target now decodes with the Unorm4_4_4_4Truncated packing, whose exports and partial-write merges pack without the rounding step, instead of being refused.
A CB resolve of a multisampled 4_4_4_4 unorm target was refused. Resolve it with the fragment pass the 11_11_10 float resolve uses: average each 4-bit field's codes, rounding halves up with ROUND_MODE clear and truncating with it set, as measured on gfx1036.
|
GCN5 data point, the generation not in your list. I tested head
This covers the fragment-pass resolve, which matches your rule on gfx900 too. I did not measure what Vega's own hardware resolve does with 4_4_4_4, so this says nothing about whether the round-half-up/truncate rule you measured on gfx1036 holds on other generations. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The shader and state changes look consistent with the stated behavior, but review coverage is incomplete because one changed file was excluded and not all included changed files were inspected.
What I ran
Reviewed head 43cba43a37853d35c3f0f3238a948d1d37da76af using the prepared diff and repo_read.py; no tests or build commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | Main resolve and conversion paths inspected |
| Tests and build | not run | Relied on author-reported results |
Findings
Blocking
None identified in the inspected code.
Non-blocking
The PR changes float 11_11_10 NaN packing and rounding behavior alongside the 4_4_4_4 work. Its description and tests give a separate measurement basis for that change, but this review did not inspect every related implementation and test path.
Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was excluded from the review bundle because it was too large; only its changed resolve-test hunk was read. Other included changed files not listed as inspected were not fully reviewed. The author-reported test results were not independently run. The review did not verify behavior on gfx1013, Windows, NVIDIA, or a physical console.
Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch; selected ranges from core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp, core/libs/prx/libSceAgcDriver/Graphics/shaders/FirstSample.frag, core/libs/prx/libSceAgcDriver/Graphics/src/FirstSampleCopy.cpp, core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, core/shader/recompiler/Recompiler.hpp, core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp, and core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvFormatConvert.cpp.
To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files and independently run the reported checks before making a formal approval decision.
|
The 11_11_10 float NaN packing and rounding changes in this diff are #23206's commit ( AI-assisted: yes |
|
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.
|
|
This passed review on 43cba43, but it now conflicts with main in Graphics.cpp, RequestSerializer.cpp, FragmentOutputSpecialization.hpp and 1 more. Please merge main into the branch and push; it goes back to the merge queue on the new head. |
ligmaSec
left a comment
There was a problem hiding this comment.
Trial merging this head with main 63db72fb61 conflicts in the resolve implementation, graphics fixture and three shader format/serialization files. Please reconcile the packed mode through both the color export and resolve paths in the same rebase. Keep coverage for integer tie-up and truncation at 2x, 4x and 8x, plus the refusal when the source and destination modes differ. The paired Vulkan run is pending the merge resolution.
AI-assisted: yes.
What
A CB resolve of a multisampled 4_4_4_4 unorm color target was refused (
CB resolves of 4_4_4_4 unorm color targets are unsupported). It now runs through the fragment pass #23225 added for 11_11_10 float, with two new variants ofFirstSample.frag. Each averages the four 4-bit fields over the samples:CB_COLOR_INFO.ROUND_MODE(sum + n / 2) / n, halves round upsum / n, truncatedThat is the rule measured on a 7800X3D iGPU (gfx1036) with Mesa 26.0.6 RADV's hardware resolve (
method=HW), RB+ off,VK_FORMAT_R4G4B4A4_UNORM_PACK16, 256x256. Per-sample codes were rendered and read back through 1-sample draws, and the rule matched every one of the 262,144 fields for 2, 4 and 8 samples in each mode. Rounding halves to even fails, and so does averaging the normalized floats.The probe set
ROUND_MODEon both targets at once, so a resolve between 4_4_4_4 targets whoseROUND_MODEor layout differ is still refused.FirstSampleCopy'saveragePackedflag becomesPackedAverage(None,Float11_11_10,Unorm4_4_4_4,Unorm4_4_4_4Truncated), andMultisampleTargetkeeps one resolve pass per kind. The debt fragment changes the "4_4_4_4 CB resolves" entry.Tested
Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV,
maind50640e264with #23258's commits first.agc_driver_packed_unorm4444_color_targetnow resolves 2-, 4- and 8-sample tiled targets in both modes and compares every pixel with the rule above. The expected words come from the codes each sample was drawn with.agc_graphics_profile_drawchecks that the resolve decodes, and that a mismatchedROUND_MODEis refused.a CB resolve of a two-sample 4_4_4_4 unorm target with ROUND_MODE 0: pixel (0, 0) inside the scissor holds 0x774e, expected 0x884f.agc_driver_packed_unorm4444_color_targetsolo: 3/3 on each GPU.agc_driver_packed_unorm4444_color_target,agc_driver_packed_unorm_color_target,agc_driver_packed_float_color_targetandagc_graphics_profile_drawwithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerandctest -V: 4/4 on both GPUs, 0VUID-lines.ctest -R '^agc'(1965 tests): the only failure isagc_driver_image_table_packed_guards, which fails onmaintoo (agc_driver_image_table_packed_guards fails on AMD hardware (RADV, RDNA2 and RDNA3): unrecoverable packed table format was not poisoned #22512).Not tested: gfx1013, Windows, NVIDIA, and which target's
ROUND_MODEthe hardware applies when the two differ.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)