Repository navigation
fix(agc): accept geometry programs with fewer GS and ES input VGPRs - #5604
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the current head and the relevant translation path. DecodeShaderStages does not use the input-allocation counts to build MeshConfiguration; the mesh prologue initializes the fixed v0-v8 layout that the translated shader consumes. The regression exercises XPSemu’s GS=1/ES=0 registers, and the reported graphics tests plus RTX 3080 probe give direct coverage of the rejected path. I found no blocker in this diff. The open stack dependencies are documented and should remain prerequisites to merging.
|
Windows test of #5604: Windows 10 (19045), MinGW-w64 GCC 15.2, Release, AI-assisted (Claude Code). |
74c043e to
f535918
Compare
|
Rebased onto |
|
A Linux run on NVIDIA, for the hardware-driver case: Ubuntu 24.04, RTX 4070 Ti, driver 595.99.02, GCC 13.3, Release,
AI-assisted: yes |
|
Checked: the VGPR-count check removed in |
What
DecodeShaderStagesrejected a geometry program (non-NGGVGT_SHADER_STAGES_ENpath) unless its GS and ES input VGPR counts were both 3:SPI_SHADER_PGM_RSRC1_GSbits 29-30 andSPI_SHADER_PGM_RSRC2_GSbits 16-17. A smaller count throwsunsupported geometry VGPR allocation. This PR removes that check.The counts only say how many of the hardware's input VGPRs the program reads. In the merged ES/GS layout the inputs sit at fixed registers: the GS inputs in v0-v4 (vertex offsets, primitive ID, instance ID) and the ES inputs from v5. The mesh translation in
InstructionTranslator.cppalways initializes v0-v8 at those positions, whatever the counts are. So a program that asks for fewer inputs reads a subset of what is already there.Graphics.cppgains a decode check with the registers XPSemu's probe sets,SPI_SHADER_PGM_RSRC1_GS= 0x222c0007 (GS count 1) andSPI_SHADER_PGM_RSRC2_GS= 0x00c00010 (ES count 0). The state now decodes to the same geometry configuration as with 3/3, wheremainthrows.Tested
On the PR head f535918 (rebased onto
maina5f493f, which added a fast-launch exemption to the same check; the line is still removed whole), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release:agc_driver_graphicspasses 5/5 (--repeat until-fail:5) on both. It fails onmain.State.cpporGraphics.cpp.XPSemu (PPSA97358, an xemu port), Windows 11, RTX 3080: its stop is #5437. With #5061, #5187 and #4958 merged locally and relinked with
--windows-fixed-base 0x400000, its GPU feature probe (render_geom_shader_trianglesin xemu'sgpuprops.c) draws with this shader. On that stack without this change, the draw fails withunsupported geometry VGPR allocation(shown with #5177), the probe's submission never completes, and xemu asserts after 10 s (VK_ERROR_DEVICE_LOST). With this change (forktest/verify-xps-gs, the same one-line change), the submission completes, the probe passes, and xemu runs its UI loop at about 72 fps. It then needs the user's own Xbox BIOS files. On Linux (llvmpipe) the draw goes through too; llvmpipe's own LLVM then fails to compile a later shader (Cannot emit physreg copy instruction).check_conventions.pypasses.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)--windows-fixed-base/--linux-fixed-base) is onmain, so XPSemu reaches this check onmain.