Repository navigation
feat(agc): run registered merged hull programs (binary type 3) - #6679
Conversation
|
A note on overlap: #6612 (Crimson Desert, PPSA25286, opened 10-15) also takes a registered type-3 program at 0x148 with nothing at 0x108, in the same lines of The two handle it differently. #6612 compiles the program twice: once as the local role, with no hull threads in Crimson Desert's merged hull draw has If this lands first, I'll move #6612 onto your merged hull, drop its type-3 split, and check that Crimson Desert gets as far as before. AI-assisted: yes |
|
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.
|
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A heads-up on the request version: #5884 merged with version 31 for AI-assisted: yes |
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8f93aa0 to
36529f1
Compare
|
Thanks @milescoviello, good catch: after #5884 this PR still merged cleanly with AI-assisted: yes (Claude Code) |
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fresh Windows11/RTX5070Ti617.42 cross-test on current integrationc6bd8b539047dacb9ddc95b41c45e69b78d39f19 (main d9b696d + shared-table/007 boot stack + canonical #6679 36529f1 and #6364 9fffcea; #4339 excluded):30/30 selected native controls PASS15.94s, no skips. Includes storage_flush_ordering, storage_write_back_overhang, depth_storage_dispatch, tessellation, prepared_graphics and its unset/0/1 prebuild cases, serializer, shader memory/disk cache, shared tables and draw-cache checks. 6364 negative control: retained the new fixture and other integration code, removed only FlushPending's PendingWriterSerial/Reap/Sync/FinishUpTo wait block, rebuilt the unpatched driver and ran the fixture. It FAILS in0.37s with Public branch https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-level-two-lane . Matched driver/Agc/VideoOut now staged together, same2GiBfree/28GiBprivate guard. Starting007; title level/cinematic outcome still pending, so the native pass is not claimed as playable gameplay. AI-assisted: Codex; title data local. |
36529f1 to
01947dd
Compare
|
@milescoviello #6679 is rebased onto AI-assisted: yes (Claude Code) |
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
01947dd to
37ec97e
Compare
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An AMD data point after the merge. Setup: Windows 11, WinLibs GCC 15.2.0, Release, AI-assisted: yes (Claude Code); results above were run on this machine. |
|
@wachi35676 thanks for the data point. I can't reach that case on an AMD GPU here. On the Ryzen 9 7950X3D's iGPU (RDNA2, RADV, Mesa 26.2.4), The test stops at its first failure, so in your run the separate-hull cases before the merged ones passed. (16, 24, 40, 255) is the test's background colour, so the level-1 patch wasn't drawn at all. The difference is in what the merged lowering adds to the same patches. Three things on your machine would narrow it down:
AI-assisted: yes (Claude Code) |
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Regression on AMD (Windows):
The tested GPUs above are lavapipe and an RTX 3080, so this may be AMD-specific. I can run a build or a diagnostic on this card if that helps. |
|
@JJenkx thanks for the bisect, and yes, a run on that card would help. An AMD data point from Linux first:
So RADV draws the merged programs. @wachi35676's RTX 5070 Ti passes on the same Windows build, so what you both see points to AMD's proprietary Windows driver. On the RX 6700 XT, the same three checks I asked @wachi35676 for above would narrow it down:
AI-assisted: yes (Claude Code) |
|
@SleglJan the three checks on the RX 6700 XT (Windows 11 22621, AMD driver 26.8.1, MinGW GCC 15.2 Release),
|
|
@JJenkx thanks, that helps. The two colours say different things about patch 0:
So patch 0 differs between the two modes on that driver, while NVIDIA and RADV draw it flat. The domain program passed earlier in the same run with the separate hulls, so the difference is in the merged program's local or hull half. Either the merged lowering relies on behaviour Vulkan doesn't guarantee, or the driver mishandles it. I'm reading the lowering now. If a diagnostic build would separate the candidates, I'll push one to a branch on my fork and ask you to run it. AI-assisted: yes (Claude Code) |
|
Correction to my last comment: the Check 3 is still not done. The only Windows build of the validation layer I could get without the SDK (MSYS2's, 1.4.363) needs the GCC 16 C++ runtime. Loaded into this GCC 15.2 build, it hangs at layer initialization. I will report it if I get a working layer. |
|
@JJenkx thanks for the correction. With the centre background in all ten runs, the library link is out. The validation-layer check waits for a working layer. A diagnostic build would separate the remaining candidates. The branch
From the build directory, with
On a driver that works, runs 1, 2, 3 and 5 print "Tessellation tests passed", and run 4 ends with "20 checks failed, 20 of them the level-0 patch drawn by design" and exits 0. In run 4, patch 0's blue shows what its hull read as the level source:
All five runs pass on an RTX 3080 and lavapipe, and on RADV (gfx1036) with the two computed-index cases skipped locally (#5444). There, run 4 ends 16 of 16. Runs 2–4 under the validation layer on the RTX report no AI-assisted: yes (Claude Code) |
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d: local, hull, domain and NGG geometry stages, the hull halves merged in one registered type-3 program, the domain and geometry halves in one type-2 program. The domain half runs as the tessellation evaluation stage and captures each vertex's ESGS item, and a mesh shader runs the geometry half on the captured items. Registered type-3 merged hulls come from boykopovar#6679; this adds 16-bit LDS reads and writes in tessellation stages, which Crimson Desert's merged hull uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
PPSA11386 (007 First Light) registers its tessellation hull programs as type 3: one binary with the local and the hull part, addressed through
SPI_SHADER_PGM_LO_LS(SH 0x148), with noSPI_SHADER_PGM_LO_HS. The local part runs on the lanes belows3[7:0]and writes LDS, ans_barrierfollows, and the hull part runs on the lanes belows3[15:8]and may store the registers the local part filled.mainskips type 3 at registration (#1893) and its draw decode asks 0x148 for a type-5 local half, so the title stops in its level load:registered program refers to an incompatible shader binary type#3444 handles a header fused at runtime that selects a registered back half; a registered type-3 binary has no back half to select.
Changes:
mergedHull. The hull user-data address (SH 0x102/0x103) is optional for it:s[0:1]take it, without the range check, when the draw sets it and are zero otherwise (the separate hull half keeps requiring and checking it). Type 3 is prepared with its stage group like type 5 and takes its float mode fromRSRC1_HS.gl_VertexIndexandgl_InstanceIndexin a 16-byte record per input control point.v2andv5come from the record of control pointmin(gl_InvocationID, inputs - 1),v3is the relative vertex id, and the LDS becomes a per-control-point output array (ControlShared): a control point writes its own record and reads any record of its patch after the barrier, with the stride taken from the code as for the local stride. Registers live across the barrier stay in the invocation.HostSubgroupSize1, as vertex programs do without vertex subgroups). Its lanes aregl_InvocationID, not host subgroup invocations, andmain's hull lowering already turns every lane-dependent value into a per-invocation one (lane id, own-lane bits) and refuses other lane masks. In the test's merged program thes_cbranch_execzaround the local part is the only wave-level operation left: with the device's subgroup it took a subgroup ballot (GroupNonUniform,GroupNonUniformBallot), which lavapipe rejects in the tessellation control stage (subgroup capability 61 is unsupported for shader stage 2). With one lane per invocation the branch tests the invocation's own lane and the module declares no subgroup capability, on lavapipe and on hardware alike.s_barrierthat some invocations do not reach or that sits in a loop; reads or writes of another lane's register (v_readlane_b32,v_writelane_b32, DPP,ds_swizzle_b32,ds_permute_b32,ds_bpermute_b32,v_permlane16_b32), which one lane per invocation does not hold; outputs beyond the device's tessellation control limits; fetch subroutines.AppendProgramMemory, used by the draw and byPrepareGraphicsStages); a request's memory regions must not overlap (RequestMemoryView memory regions overlapotherwise).UserDataWords). The local and hull stages both hold SH 0x10c onwards;mainwrote only the first, the local stage, which of a merged program only writes the vertex record. Separate hull halves now get the words in both halves too, as both read the same registers.mergedHullis part of the recompile cache key of the local and hull stages, the draw decode comparison and key, and the request serialization: version 39, a byte at the end of the tessellation configuration.gl_InvocationIDwhen it writes a per-control-point output (ControlOutput,ControlShared), not only when it reads its lane id: those writes are indexed by it.PrepareGraphicsStagestakes its memory fromAppendProgramMemorytoo, so it now leaves out empty regions, as the draw already did.The
Merged hull programsentry indocs/dev/debt/shader.mdrecords where this differs from the console: the same control point of the same patch per hull lane, the register layout taken from the separate halves (not measured on hardware), the one-lane wave-mask branch (an invocation whose own lane fails skips the scalar instructions the console runs for the wave) andv_readfirstlane_b32(the invocation's own value), runtime buffer loads for the vertex fetches, and the optional user-data address.Overlap (trial merges with
git merge-treeof the 98 open PRs that touch the same files, against this branch and againstmain3aa4448; 82 give the same result with both, 40 of them merging cleanly):mainwrites version 38. feat(agc): remap a viewport depth range the device cannot express into the vertex shader #4650 took 35 (target.depthRangeRemapand, with a vertex context,depthRemapMode), perf(shader): flush f32 denormals in hardware when a startup probe matches the emulation #6503 took 36 (target.float32FlushToZero), fix(agc): replace with a stencil operation value the pixel shader exports #6762 took 37 (the pixel stage'sstencilOperationValueExport) and feat(shader): emulate barycentrics and per-vertex parameters on the mesh path #6941 took 38 (the mesh barycentric layout, a flag after the draw fields); fix(recompiler): run a pixel shader the guest does not iterate once per pixel #6470 took 34 before that. So this change takes 39 and readsmergedHullonly from 39 on; version 38 and older requests read as not merged.PreparedControlFlow::MatchesinRecompiler.cpp, on the line after the one where this change addsmergedHull, and fix(agc): drain the draw pipeline before a vertex table read overtakes a queued write #7691 and perf(agc): compile uncached draws ahead of queue 0 #6188 an include line inDrawCache.hppwhere this change adds one; they conflict textually.TessellationLowering.cpponly on theLoweringmembers (itsDependenceenum and map besidelocalStrideandsharedStride).docs/dev/debt/shader.md; placement only.maininDraw.cpp, and with this change in the same files; perf(agc): compile uncached draws ahead of queue 0 #6188 too, plus theDrawCache.hppinclude above. perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE) #6946 (fbe1f8b) merges withmaincleanly and conflicts with this change inDraw.cpp(theAppendProgramMemorycall and the record'sUserDataWordspatch). feat(agc): look up table images at run time through a device image table on the GPU heap (APS5_GPU_PATH) #7642 and perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE) #6946 each turn the per-drawmemoryandprogramsinto a per-draw tail;AppendProgramMemorythen fills the tail's vector.Tested
mainef0eed9, after fix(shader): test an empty exec mask in s_subvector_loop_begin with one compare #7623 changed the debt line next to this change's entry (placement only). There, on the Linux build node, the change's own 12 tests pass (request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring, theagc_driver_prepared_graphicstests, the two journal tests, perf(agc): queue CPU-path indirect draws on the draw pipeline #6931'sagc_driver_pipelined_indirect_drawandguest_requested_exit). The wider runs below are onmain3aa4448. feat(shader): emulate barycentrics and per-vertex parameters on the mesh path #6941 took request version 38 there, so this change writes 39 and readsmergedHullonly from 39. Both sides wrote 38, so git mergedRequestSerializer.cppwithout a conflict at the old number; the tests catch that, as they did on the rebase onto feat(agc): remap a viewport depth range the device cannot express into the vertex shader #4650's 35.verifyMergedHullConfigurationfinds the flag 52 bytes from the end; the fields after it include the draw fields, feat(shader): emulate barycentrics and per-vertex parameters on the mesh path #6941's mesh barycentric flag, feat(agc): remap a viewport depth range the device cannot express into the vertex shader #4650's depth-remap fields and perf(shader): flush f32 denormals in hardware when a startup probe matches the emulation #6503's flag. It reads version 30, 31, 32, 34, 35, 36, 37 and 38 requests as not merged.main's version 38 format.main's new 1000-character limit, with the gap first.lastDrawablescan after this change's threeUserDataWordslookups (one textual conflict inDraw.cpp).writablePrograms;AppendProgramMemoryfills the vectormainreserves.request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring,agc_driver_prepared_graphics,agc_driver_prepared_graphics_prebuild_unset,agc_pipeline_journal,agc_driver_pipeline_journalandguest_requested_exitpass.ctest -R 'agc|shader|recompiler|request|tess', 814 tests: this change passes 735, skips 60 and fails 19, and so doesmain3aa4448 built the same way, with the same skips and the same failures:shader_cache_runtime_sources,agc_driver_lookup_log_fits_build, plus 17 of the 18 listed below for 324e0e4 (agc_driver_storage_write_back_overhangpasses now). The container does not permit userfaultfd, and 15 of those 17 report guest memory that is not write-watched or needs to be.agc_driver_pipelined_indirect_draw, perf(agc): queue CPU-path indirect draws on the draw pipeline #6931's test, passes on both.main324e0e4, the previous head (4e7fa2b, version 35): 744 of 762 pass, the same asmain324e0e4. Both fail the same 18:agc_driver_bc_block_copy,agc_driver_depth_compare_copy,agc_driver_guest_memory_lifetime_converted,agc_driver_image_srgb_sample_copy,agc_driver_image_srgb_sample_copy_forced,agc_driver_image_table_vouched_lookups,agc_driver_image_table_vouch_queued_draws,agc_driver_msaa_dcc_clear_2,agc_driver_msaa_dcc_clear_4,agc_driver_msaa_dcc_clear_8,agc_driver_native_depth_bda_clear,agc_driver_native_depth_clear_refusals,agc_driver_native_depth_clears,agc_driver_native_depth_retirement,agc_driver_native_multisample_depth,agc_driver_staged_clear_sampled_read,agc_driver_storage_write_back_overhang,agc_storage_kept_unit_settle.BUILD_TESTING=ON, lavapipe (Mesa 26.2.4, LLVM 23.1.1).ctest -R 'agc|shader|recompiler|request'onmain92e5041, with the earlier version-31 head:main: 591 of 601 pass.agc_storage_kept_unit_settle,agc_pending_key_stores,agc_driver_bc_block_copy,agc_driver_depth_compare_copy,agc_driver_native_multisample_depth,agc_driver_staged_clear_sampled_read,agc_driver_storage_write_back_overhang,agc_driver_native_depth_retirement,agc_driver_native_depth_clears,agc_driver_native_depth_clear_refusals(most need write watching, which the container does not have).MergedHull*inTessellation.cpp) are written for these tests. Each is an eight-dword entry, thenmain'sLocalCode(without itss_swappc), two dwords of glue andmain'sHullCodewith one LDS read offset changed (LocalCodeandHullCodeare from the same file). The entry's lane id isHullCode's, and its other instructions are assembled withllvm-mc(gfx1010).MergedHullReadLane'sv_readlane_b32is also assembled withllvm-mc(gfx1030).MergedHullDivergentBarrierinserts ans_barrier.MergedHullRegisters,MergedHullForeignRecordandMergedHullOutsidePatchchange a store's registers or an LDS offset by hand. The entry's layout and the vertex-table slots ofCheckMergedHullVertexTablesfollow PPSA11386's merged programs, and the entry's first seven dwords (the lane test) also occur in them; apart fromHullCode's ownv_mbcntpair, no run of four consecutive dwords from these programs occurs in the title's shader binaries captured here. ThePreparedGraphics.cppcases use 64 filler words ands_endpgm, asmain'sFixturedoes.agc_driver_tessellation: two merged-hull draws (MergedHullCode, andMergedHullRegisters, whose hull part stores a register its local part filled) checked like the separate-hull draws (RequirePatches); refusals for more input than output control points, an LDS write into another control point's record, an LDS read past the patch's records, a divergents_barrierand av_readlane_b32of lane 0 (which the one-lane emitter would otherwise compile); the merged hull stage compiled with the device target declares noGroupNonUniformcapability; registration and graphics ABI resolution of a type-3 stage group (twice, the second from the prepared ABI).agc_driver_prepared_graphics: the decode of a merged hull draw at ABI resolution and at draw time (roles, entry points, user SGPR layout, user-data address set, unset, zero, and set to an unmapped address that the program does not need), its program memory listed once and accepted byRequestMemoryView(and used as the stages' request memory), the user-data words of SH 0x10e in both stages, preparation as two separate stages that the draw reuses, separate halves still decoded as before and still requiring the address; a merged program's vertex tables read from its user-data slots behind the eight hidden words.agc_shader_memoryandrequest_serializer: themergedHullbyte round-trips; version 30, 31, 32, 34, 35, 36, 37 and 38 requests (38 ismain's current format; with and without tessellation) read as not merged, keep their fields and re-serialize to the version 39 bytes; the version 39 fixtures; version 40 is rejected. With the field read from version 35 on, as git merged it on the rebase onto feat(agc): remap a viewport depth range the device cannot express into the vertex shader #4650, both fail withRequestSerializer: truncated data.main1b1f848 (after feat(recompiler): run single-wave wave64 compute programs at one lane per invocation on 32-lane hosts #5405 took version 32), the same node:request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring, the fouragc_driver_prepared_graphicstests andguest_requested_exitpass (9 of 9).ctest -R 'agc|shader|recompiler|request': this change 617 of 626 pass,main1b1f848 built the same way 617 of 626; both fail the same nine (agc_driver_bc_block_copy,agc_driver_depth_compare_copy,agc_driver_native_depth_clear_refusals,agc_driver_native_depth_clears,agc_driver_native_depth_retirement,agc_driver_native_multisample_depth,agc_driver_staged_clear_sampled_read,agc_driver_storage_write_back_overhang,agc_storage_kept_unit_settle).maineb901bc with the previous head 36529f1, the same node:request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring, the fouragc_driver_prepared_graphicstests andguest_requested_exitpass (9 of 9).main92e5041, earlier head):mainwith only the tests that compile there (the type-3 registration case inagc_driver_tessellation, the serializer fixtures):agc_driver_tessellationfails withregistered program refers to an incompatible shader binary type,agc_shader_memorywithnew requests did not use serialization version 31(39 now), andrequest_serializeraborts on its version fixture. The other new cases use the new field and functions; with the change and one part reverted at a time, the check written for that part fails: the draw decode not detecting type 3 (agc_driver_prepared_graphicsandagc_driver_tessellation:registered program refers to an incompatible shader binary type); nomergedHullbyte in the serialization (a merged hull configuration was lost in serialization,request_serializeraborts); the lowering not treating the program as merged (unsupported LDS access in a tessellation stage); the hull stage at the device subgroup size (the hull stage of a merged hull program declares subgroup operations ...); no cross-lane refusal (a tessellation program was accepted although another lane's register: av_readlane_b32of lane 0 compiles silently); the program memory without the dedupe (a merged hull draw's program memory does not list each code and header region once);UserDataWordsstopping at the first program (an indirect draw's user-data register does not reach both stages of a merged hull program); the hull user-data address required (merged shader user-data address is null); the optional address range-checked (guest memory is not readable at 0x10); the read-past-patch check removed (a tessellation program was accepted although reads LDS outside its patch's control point records).MergedHullCodewithout the one-lane layout declared capabilities 61 and 64 with oneOpGroupNonUniform*instruction; with itss_cbranch_execzreplaced bys_nopit declared neither, so the branch is the only source.Draw.cppindirect record loop (onlyUserDataWordsis), the draw key'smergedHull, and the refusals for outputs beyond the device limits, a barrier in a loop and fetch subroutines.agc_driver_tessellationtakes under 1 s on the node.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.maineb901bc: NVIDIA GeForce RTX 3080 (615.78.08), CachyOS (Linux 7.2.10), GCC 16.2.1, Release withBUILD_TESTING=ON,ctest -R 'agc|shader|recompiler|pm4|draw|position|tess|hull|request':agc_driver_stencil_ref_exportskips andagc_driver_store_over_untrackedfails.mainbuilt the same way: the same 625 pass, the same skip and the same failure, on the same test list.agc_driver_store_over_untrackedfails on both withthe result did not reach a block the CPU left alone; Windows: StoreOverUntracked fails at "the first result was not stored" #6347 tracks the same test failing on Windows.main4186f06 plus open PRs, unpublished local fixes the title needs, local logging and scripted input, and the title's two feedback-wait limits widened in its executable as described in 007 First Light (PPSA11386): the terrain crash after Resume is a stale read of a GPU feedback buffer past the title's own wait limits #6172 (local only). These runs used the earlier version-31 head, before perf(agc): queue CPU-path indirect draws on the draw pipeline #6931's queued indirect path; the version changes do not touch the draw path.main-based stack without a merged-hull change stopped in the level load after present 1188 withregistered program refers to an incompatible shader binary type.mainup to 5d9dcc4, the title stops in the level load after present 1195 withmerged shader user-data address is null: a merged hull draw there leaves the hull user-data address null.Checklist
main; feat(agc): draw tessellation followed by an NGG geometry stage #6612 builds on this changeNotImplemented_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