Repository navigation
fix(agc): emulate two-sample DB_ALPHA_TO_MASK 0xe701 dithered alpha-to-coverage - #10515
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the state decode, shader request propagation/cache key, serializer version bump, and the two/eight-sample coverage tables and regression cases. The new path is constrained to the measured 0xe701 register word, matched two-sample state, supported sample locations and floating export formats; the existing eight-sample path remains separately selected. The reported test matrix includes state rejection tests, request serialization, focused GPU validation with repeats, a negative control, and a title boot. I cannot run the Vulkan tests locally (no Vulkan/GPU test setup here), and the hosted jobs for this PR are non-product checks only; the hardware results remain the author-reported measurements on gfx1032, not PS5 confirmation.
|
Rebased onto main
Since the PR was opened, Bugsnax (PPSA01503) also reaches gameplay with this change: about 18-20 FPS, exit 0, no GPU fault (#9900). AI-assisted: yes (Claude Code) |
f179568 to
bb2e649
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed current head bb2e649. The two-sample mode remains separately gated by the 0xe701 word, matched two-sample raster/DB_EQAA state, one pixel iteration, measured locations, and supported float exports; its sample-count tag is propagated through the draw key and request serializer. The existing eight-sample path remains distinct. The author-reported focused GPU/serializer matrix is pinned to earlier head f179568, so I did not treat it as a rerun of bb2e. The dependent #10581 report provides additional author-reported Windows/Vulkan validation of the stacked behavior on base fa515de. Hosted eligibility, conventions, labels, and report pass; all product test jobs are skipped, and I could not run the GPU tests locally.
…o-coverage Bugsnax (PPSA01503) draws with DB_ALPHA_TO_MASK 0xe701 (quad offsets 3, 1, 2, 3 without OFFSET_ROUND) on a two-sample target and stopped on the refusal of every dither but the eight-sample 0x18701. The pixel shader now applies an eight-level per-quad table for it, measured natively on gfx1032, and the request's dither byte selects that table (serialization version 47). It is accepted only for two matched raster and DB_EQAA samples, the two measured location pairs and FP16_ABGR or 32_ABGR exports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bb2e649 to
2ff14f3
Compare
|
Rebased onto current main c8d34aa as The fresh native control reproduces main's unsupported |
|
First NVIDIA and AMD-proprietary run, on Windows. Windows 11 10.0.26300, WinLibs GCC 15.2.0, Release;
AI-assisted: yes (Claude Code); results above were run on this machine. |
|
A Windows run of
AI-assisted: yes (Claude Code) |
|
Recorded the additional result in the PR description with its exact tested pins and limits. Contributor-reported Windows follow-up: @ycbuzi tested head AI-assisted: yes. |
|
Checked the interdiff against the head we reviewed: a rebase onto current main where only the alpha-to-coverage debt line needed resolving; all production and test deltas are unchanged. Re-checked the state decode and precheck, draw/cache/register keys, serializer v47 and the SPIR-V table selection, and the 0xe701 path limited to the measured state with everything else throwing. Windows runs from @wachi35676 and @ycbuzi on NVIDIA and AMD proprietary pass; merged. |
What
Bugsnax (PPSA01503) stops 14 s in, before its first frame:
The rejected draw has dithered alpha-to-coverage on a two-sample target (state in #9900):
DB_ALPHA_TO_MASK0xe701: quad offsets 3, 1, 2, 3, noOFFSET_ROUND.DB_SHADER_CONTROL0x50:ALPHA_TO_MASK_DISABLEis clear, so alpha-to-coverage is in effect.PA_SC_AA_CONFIG0x108001andDB_EQAA0x101001: two samples.PA_SC_AA_SAMPLE_LOCS_PIXEL_*_00xc44c: the locations (-4, 4), (4, -4).#4451 added the eight-sample default dither (
0x18701) from a table measured on gfx1036. This value is a different offset set at a different sample count, so it cannot share that table.This PR adds a two-sample table for
0xe701:ditheredAlphaSamples(8 or 2) goes from the decoded state through the pixel context toStoreDitheredAlphaCoverage.StoreDitheredAlphaCoveragepicks the eight-level table at two samples. It indexes the table withfloor(clamp(alpha, 0, 7/8) * 8)and the pixel's position in the 2x2 quad, as the 64-level table does.0x18701) or 2 (0xe701), and the serialization version goes from 45 to 46. A version 45 request with 2, or any request with a value above the version's maximum, is rejected.0xe701is accepted only in the measured state:Anything else throws with its own message.
ALPHA_TO_MASK_DISABLEturns it off, as it does0x18701.Measurement
The table was measured natively on a Radeon RX 6650 XT (gfx1032), with RADV 26.2.4 built from source with a local patch. The patch lets an environment variable replace the offsets and
OFFSET_ROUNDthat RADV programs intoDB_ALPHA_TO_MASK; it is not part of this PR. A standalone Vulkan probe draws one 4x4 tile per alpha withalphaToCoverageEnableandRADV_DEBUG=novrsflatshading, then reads every sample back withtexelFetchfrom a compute shader.The sweep has 1163 alphas:
Each is drawn into RGBA16F and RGBA32F targets.
0x18701, eight samples0xe701, two samples, RADV's locations (4, 4), (-4, -4)0xe701, two samples, the title's locations (-4, 4), (4, -4) throughVK_EXT_sample_locationsMasks per level, in pixel order X0Y0, X1Y0, X0Y1, X1Y1:
NaN, negative values and -0 give level 0; values at or above 7/8, including +inf, give level 7.
The probe, the RADV patch, the raw outputs and the register capture are in 20261023-a2c-e701-two-sample.tar.gz.
Tested
Current Linux refresh:
2ff14f34e36610e8a02585b247c7c9240a5f1e5ais one linear commit on mainc8d34aa8f4d8058d57169cc1e423ba6db00faaf0. Only the additive debt context conflicted; all 16 production/test added-and-removed-line sequences match original headbb2e64983cf97fd13cb19bc44d32aba44eb60a56exactly. Main's adjacent single-sample/depth debt update is retained. Fresh fulllibs/relinker and focused-fixture builds pass on both arms.The same focused set is 10 tests on plain main and 11 on the change (the extra two-sample case): all pass three repeats, no skips, zero VUIDs, with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,MESA_SHADER_CACHE_DISABLE=trueandctest -V. The actual Khronos layer loads on every repeat of five physical tests on main and six on the change; mock state, shader-IR and serializer checks are CPU-only. A fresh private negative control forcing the eight-sample table fails the two-sample pixel comparison three times without a validation error. Restoring the exact clean source and rebuilding makes both dither modes pass three repeats each, again with zero VUIDs.Fresh native PPSA01503 checks reuse the four existing bundled modules, including root FMOD modules through
--module-dir ., with independent writable seeds/caches and the same scheduled input route (main aborts before its first pulse). Plain main aborts with exit 134 at about 13s on unsupported0xe701, before a frame was verified. The change renders the title/foliage, reaches New Game/save-slot selection, and is in the rainy first-person opening at 305s; ordinary window close at 310.6s gives exit 0. Both runs actually load the validation layer and have zero VUIDs. Configuration/saves and three copied seed files are restored, the five shared raw ELF inputs hash unchanged, and no game PID remains. No kernel GPU-fault/reset entries appear in the bounded test window. The run does not establish later tutorial/bridge completion, audio, movement verification, an FPS comparison or a new furthest point beyond earlier reports. #10581 and other local fixes are not included.Conventions against current main have zero errors and one warning for the touched long alpha debt entry; origin/main comparison has zero errors and seven debt-length warnings. Whitespace and current-main merge checks pass. Per-arm builds, complete focused logs/JUnit, negative control, native reports/reviews, selected screenshots and patch (SHA-256
34fe21fd4ab1ddc6066d92f50120490c4ff341c1bac49875334726adaa85a4d3). No title executable, module, assets, saves, raw SDK bytes or binary CPU profile is included.The measurement and validation below are historical on their stated earlier heads. The hardware table's measurement was not repeated, and neither the full 2,014-test run nor Windows was rerun for this refresh.
Linux 7.2.9, Ryzen 9 7950X, Radeon RX 6650 XT, RADV Mesa 26.2.4, Release.
New tests:
TwoSampleDitheredAlphaToCoverageTests, inagc_driver_alpha_to_coverage_state. It covers acceptance for both location pairs and forMASK_EXPORT_NUM_SAMPLES0 and 1. It also covers refusal of:ALPHA_TO_MASK_EQAA_DISABLE;agc_driver_two_sample_dithered_alpha_to_coverage, a GPU test. It draws 56 measured cases (FP32 and FP16 exports at each k/8 and its neighbours, plus the special values) into a real two-sample target and checks every resolved pixel. The eight-sample test now uses the same code.The focused set (
alpha_to_coverage,agc_shader_memory,request_serializer,agc_driver_msaa_dcc; 11 tests) was run withctest -V --repeat until-fail:3,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1. All 11 pass 3/3, with noVUID-lines and no missing-layer line.Negative control. With
StoreDitheredAlphaCoverageforced to the eight-sample table,agc_driver_two_sample_dithered_alpha_to_coveragefails 3/3:With the change restored, it passes.
Full
ctest -j8. Run onmain924b18f59cand on this change (f179568345, on the same base), in the same environment. Results:agc_driver_tessellation(segfault, the Mesa 26.2 issue in agc_driver_tessellation segfaults on RADV with Mesa 26.2+: nir_opt_varyings corrupts the TCS input offset's use list (Mesa bug) #5444).VUID-sets and counts:VkWriteDescriptorSet-descriptorType-00337VkPipelineColorBlendStateCreateInfo-pAttachments-00605The focused set also passes 3/3 on
f179568345. An earlier comparison on mainc4d105021ewith6c18620c3cmatched in the same way: 1992 and 1993 tests, the same four failures, 27 skips and the sameVUID-counts.PPSA01503, natively, content version 02.000.000. Run with
APS5_PLAYGO_UNLISTED_CHUNKS=installed, because the dump has no PlayGo files.mainea695358eewith a local register print6c18620c3c, onc4d105021e)Scripted Cross presses did not leave the title screen. That is not investigated here.
Overlap
Current-main overlap scan: #6973/#6987/#6989/#6995/#7002 share the DCC recreation test dispatch/registration; #9020/#9193/#9748 change request-format fields/versions and fixtures. These are independent features, not prerequisites; whichever lands second must preserve both test paths and use the next canonical serialization version. Of 116 shared/conflict-incomplete patch captures, the two-sample symbols/word occur in this PR and its dependent #10581; this PR is not dependent on that follow-up. Combined application with those other open branches was not tested.
#8424 rewrites the opening of the same debt entry. The two changes touch different sentences, but whichever lands second has to rebase that line. No open PR implements
0xe701or a two-sample dither. Open PRs that change the request serialization version conflict on the version number; whichever lands second takes the next one.Not verified
0xe701;MASK_EXPORT_NUM_SAMPLES0, which the title programs; the measurement used 1, and no sample mask is exported.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
Contributor-reported Windows follow-up: @ycbuzi tested head
2ff14f34e3merged onto main7903201bb4, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release. The 65 selected groups ran twice on each of RTX 4070 SUPER and GTX 1650 SUPER (NVIDIA 616.92) and AMD RDNA2 iGPU1002:164e(32.0.21030.2001): 62 passed and three compared-import groups skipped per device/run. No negative control or validation-layer proof is supplied; the reported request-serializer warning also occurs in their main-only compile. These are contributor results, preserving the known skips and warning rather than a full Windows/validation qualification. Original report.