fix(agc): start the color masks and viewport control at their reset values #16053
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16053"
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?
Imported from boykopovar/AnyPS5. Originally posted by stuart-russell on 2026-11-05T13:28:02Z.
What
CB_TARGET_MASK(0x8e) andCB_SHADER_MASK(0x8f) reset to0xffffffff, andPA_CL_VTE_CNTL(0x206) resets to 0. A title that never programs them got the driver's former zeros instead: the masks meant nothing was written, andPA_CL_VTE_CNTL0 threw, or, once accepted, decoded a viewport of (-1,-1) 2x2 from registers the title never wrote, so every draw was discarded.0xffffffff.CLEAR_STATErestores the same values throughInitialContextRegisters.PA_CL_VTE_CNTLat 0 and give a draw with that value a viewport covering its render target.0x43fkeeps the register-derived viewport, and any other value still throws.drawCoversand in the draw rejection.Follow-up to #10779, which is merged.
References
cb_target_maskandcb_shader_masktracking to0xFFFFFFFF(drivers/gpu/drm/radeon/r600_cs.c,r600_cs_track_init), the hardware reset value for both masks.PA_CL_VTE_CNTLenables the per-axis viewport scale and offset; decaf-emu models the disabled case as the unscaled NDC path (src/libgpu/src/vulkan/vulkan_viewscissor.cpp) and xenia reads the same enables to derive its draw extent (src/xenia/gpu/draw_extent_estimator.cc).Tested
agc_driver_pm4(18 tests) andagc_driver_graphicspass, andtools/check_conventions.py --base origin/mainpasses, ond23df92b38.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R 'agc_driver_(pm4|graphics)' -Vpasses with noVUID-lines and without the "was not found but was requested by env var VK_INSTANCE_LAYERS" message. This machine has no Vulkan device, so that run covers the decode path only.A Windows build of the same values (MinGW cross-build, NVIDIA RTX 3070, driver 32.0.15.9186, Windows 11) ran PPSA30528 to its loading screen with audio; the run without them produced a black window. That run predates this rebase.
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)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T15:18:14Z.
Review: COMMENTED
Ran
e5e7eace2amerged onmain302864d48con Windows 11 x64 (WinLibs GCC 15.2),ctest -R '^agc_driver_graphics$' -V, withANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1, on both an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx) selected:mainmain+ only this PR'sGraphics.cppdiffQueueState.hpp/State.cppchanges, the updated test stops at "the initial viewport control is not its reset value". With them, it passes every time.agc_driver_graphicsruns againstMockVulkan, so this covers the decode path (as on the description's machine) on two more hosts, not a draw on a real device. I didn't runagc_driver_pm4.From reading:
PA_CL_VTE_CNTL0 branch skips the scale/offset registers entirely, so a title that leaves them unwritten no longer reaches the "unsupported viewport transform" refusal.depthScale,depthOffsetand the depth clamp bounds aren't set in that branch, so they keepState's defaults (scale 1, offset 0, clamp 0 to 1).drawCoversandDrawRejectionaccept the same two values asDecodeState, so the three can't disagree.AI-assisted: yes.