Repository navigation
Conversation
… writes depth as a depth pass and an EQUAL merge pass
# Conflicts: # docs/dev/debt/shader.md
…tes depth its own entry
# Conflicts: # core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
# Conflicts: # docs/dev/debt/libSceAgcDriver.md
…e memory Both passes of the split run every stage of the draw, so a store, atomic or GDS operation in its vertex or pixel shader would run twice. Such a draw is no longer split; it takes the unsplit path and throws there like any merge that kills under late tests and writes depth. The check is the one the finisher uses for held writes: ProgramWritesMemory on each program and on a user-data tail continuation, which also counts jumps it does not follow. agc_driver_late_test_merge_split gets two modes, --counting-pixel and --counting-vertex: a draw without a merge first shows the shader adds to a buffer counter, then the split draw with the same shader must throw the late-test refusal and leave the counter unchanged.
# Conflicts: # core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp # core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp # core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
# Conflicts: # docs/dev/debt/libSceAgcDriver.md
# Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
finishDraw's retry after recordQueuedLabelsAfterCapture passed a fresh local to the recursive draw, so a Split it returned would reach drawLateTestMergeSplit without its CB_TARGET_MASK bits. The draw tail now carries the caller's output, as it carries the queue and the rejection string. The DB depth copy retry draws a queue of its own, which drawLateTestMergeSplit would not redraw. That queue clears DB_SHADER_CONTROL, so it never kills and never splits; the retry now requires that.
…stMergeSplitTargets With DB_RENDER_CONTROL DEPTH_CLEAR_ENABLE, DecodeState forces the depth write and ZFUNC ALWAYS, so the merge pass's Z_WRITE_ENABLE and EQUAL patch cannot take effect. The draw already skipped the split for it, but at its own call site; the check now sits with the other conditions, which the decode tests reach. A depth-clearing draw keeps the existing refusal before either pass, which the new --depth-clear run of agc_driver_late_test_merge_split_tests checks.
…eadWithoutFormat The merge pass reads its packed target without a format, so the recompiler refuses its pixel shader on devices without shaderStorageImageReadWithoutFormat (Intel UHD 630 on Mesa). Skip there, as the test already does without pixel interlock.
# Conflicts: # core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
A draw that exports depth, stencil or a sample mask, or runs with a quad sample mask, is refused by every packed target merge. Splitting it drew the depth pass before the merge pass threw, so the refused draw left its depth and unmerged targets behind. LateTestMergeSplitTargets now takes the decoded pixel stage info and keeps such draws whole, so they take the existing refusal before either pass.
# Conflicts: # core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
…e pass's capabilities
…fragment and list the new refusals
…draw's render extent
…it with a shader that writes no memory
|
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A partial or blended write into a packed color target merges inside the pixel shader through boykopovar#8564's pixel-interlock read-modify-write, which forces early fragment tests. That throws when the shader kills pixels under late tests and the draw writes depth (
kills under late tests, draw writes depth or stencil): with early tests the killed fragments would still write depth, so alpha-tested holes would occlude what is drawn behind them. Gran Turismo 7 stops on this in the World Map with an alpha-tested draw into an 11_11_10 target (boykopovar#9020's blend), reverse-Z:DB_DEPTH_CONTROLZFUNC GEQUAL with depth writes, no stencil, one target.This branch started as boykopovar#9020 plus its own commits, with merges of boykopovar#9020's branch into it; boykopovar#9020, boykopovar#11557 and boykopovar#8564 are all in
mainnow, so its diff againstmainis the split alone (13 files). Its commits: 5451af8 (the split), 4768b4a (no split when a program of the draw may write memory), 5198b9c and 829eb0d (the split targets returned from the draw), 91e0e9d (no split when the draw clears depth), 1454d7b (a second, unmerged target in the GPU test), 8eb63a2 (the split mask kept through the label-recapture retry), 8872e28 (the depth-clear check insideLateTestMergeSplitTargets), 65ad383 (the split mask kept throughmain's recapture retries), dc3f7e7 (the GPU test skips on devices withoutshaderStorageImageReadWithoutFormat) 704f9bf (no split when the shader exports depth, stencil or a sample mask or runs with a quad sample mask), fa2d107 (no split on a device without the merge pass's capabilities), 99f4f9c (no split when the draw runs the depth-bounds test), 385f83d (no split when the depth compare fails at equal depth), f8a53dc (the debt entries moved into the branch's fragment), 5889dff (both passes drawn at the unsplit draw's render extent), 01d6097 (a GPU test of the occlusion-query refusal with a shader that writes no memory) and 62f116b (both passes prepared before either draws). The latest merge, ad5b083, mergesmaine0ef706 (the earlier c26a94d merged f281831). The split alone: frankea/AnyPS5@374556c...5451af8, and the memory check: frankea@4768b4ab4CB_TARGET_MASK, so it has no merge: the title's own late tests, kill and depth write run as they are, and depth ends up as on the console. The second pass keeps only those 4 bits and setsDB_DEPTH_CONTROLZ_WRITE_ENABLEto 0 andZFUNCto EQUAL (2). It writes no depth or stencil, which is the shape feat(agc): merge partial writes into 4_4_4_4 UNORM color targets boykopovar/AnyPS5#8564 already merges with a kill under late tests, so it blends exactly the fragments the kill keeps whose depth equals what the first pass left. Field positions and theCompareFragencoding are from Mesa's gfx103.json (DB_DEPTH_CONTROLbits 2 and 6:4,CB_TARGET_MASK4 bits per target,DB_SHADER_CONTROLKILL_ENABLEbit 6 andDEPTH_BEFORE_SHADERbit 12).Driver::drawdecides after decoding the state and before capturing any shader (LateTestMergeSplitTargets, from the decoded state andDB_RENDER_CONTROL), returns a newDrawVerdict::Splitwith the merged target'sCB_TARGET_MASKbits in an out parameter, which the draw's label-recapture retry passes on, andPacketExecutionthen runs both passes through the unchangedDriver::draw, so each goes through the usual decode, capture, pipeline and draw caches under its own register key. EQUAL needs bit-identical depth in both passes: they run the same vertex program with the same viewport and depth bias, and positions are already decoratedInvariant. With the target bits it returns the unsplit decode's render extent, whichdrawLateTestMergeSplitsets on the queue for both passes and clears on restore;DecodeStateuses it as the render extent, so both passes get the unsplit draw's scissor and default viewport from the same registers, and it throws a named refusal if a pass's attachments do not cover it. The extent is mixed into the draw register key, so a pass's cached decode never matches an ordinary draw with the same registers.ZFUNCNEVER,DEPTH_BEFORE_SHADER, alpha-to-coverage, multisampled targets, draws while an occlusion query counts samples (the second pass would count them again), draws that clear depth (DB_RENDER_CONTROL.DEPTH_CLEAR_ENABLE), whose first pass stores the clear value the second pass would compare against, and draws that merge into more than one color target (possible since feat(agc): merge a draw into more than one unclamped normalized color target boykopovar/AnyPS5#12916). Nor is a draw split whose shader every packed merge refuses: one that exports depth, stencil or a sample mask (DB_SHADER_CONTROLbits 0, 1 and 8, asDecodePixelStageInforeads them) or runs with a quad sample mask (PA_SC_AA_MASK).LateTestMergeSplitTargetsreads these from the draw's decoded pixel stage info, whose quad masks are already in host sample order. The split prepares both passes before either one draws: with a newQueueState::splitPrepare,finishDrawreturns after every stage compile and before the first snapshot or record, so aRefusedDrawunderAPS5_SKIP_REFUSED_DRAWSor aDrawCompilePendingunderAPS5_ASYNC_DRAW_COMPILEin either pass leaves the packet with no recorded work. The two passes then draw under a thread-localSynchronousDrawCompileScope, so neither can go pending between them, and a split pass is never handed to the draw finisher. A draw is not split when one of its programs may write guest memory: both passes run every stage, so a store, atomic or GDS operation in the vertex or pixel shader would run twice. The check isProgramWritesMemoryon each program and on a user-data tail continuation, the one the draw finisher uses for held writes, which also counts jumps it doesn't follow. Such a draw takes the unsplit path and throws the refusal above.Tested
ctest --test-dir build -R <pattern> -V, 3 runs each side)maine0ef706-O3 -DNDEBUG), treeC:\src\wt-14217, build dirbuild, CPU affinity 0x3FFFagc_driver_late_test_merge_splitentries (plain plus_counting_pixel,_counting_vertex,_counting_query,_depth_clear,_equal_depth,_narrow_merge,_mask_export,_quad_mask,_pending_merge),agc_driver_graphics,agc_driver_packed_float_blend,agc_driver_packed_unorm4444_partial_write,agc_driver_sample_mask_draw,agc_driver_stencil_known_replace. Env:ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layermaindoes not have the 9 split entries.C:\VulkanSDK\1.4.363.0\Bin\VkLayer_khronos_validation.json, HKLM ExplicitLayers).Insert instance layer "VK_LAYER_KHRONOS_validation": 6 lines per run onmain, 26 per run on head.was not found but was requested by env var VK_INSTANCE_LAYERS: 0 on both.VUID-lines: 0 onmain, 0 on head. Lines withUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings, counted on the earlier run of 01d6097: 20 per run onmain, 35 per run on head; the extra 15 are all inagc_driver_late_test_merge_splitC:\src\pr-results\p9335c\holdsrun.txt,main-vl-{1,2,3}.log,head-vl-{1,2,3}.log,revert-vl-{1,2,3}.logand the build logs. Chain script:C:\src\pr-results\p9335c.cmdBoth sides used the same GPU and build directory, built one after the other.
mainruns the 5 shared tests; it has none of theagc_driver_late_test_merge_splitentries. Control on the 4090: withDraw.cppback at its 01d6097 version (no prepare passes),_pending_mergefails in all 3 runs withdrew only its depth pass (the RGBA8 target changed, the 11_11_10 merge target did not) on attempt 4, with 0VUID-lines.On 5889dff, the new entry
agc_driver_late_test_merge_split_narrow_mergesplits a draw into a 32-pixel-wide 11_11_10 target beside a 64-pixel-wide RGBA8 target and a 64-pixel-wide depth target. It checks that the RGBA8 target is untouched at x >= 32, and a LESS depth probe checks that no depth was written there. Control, 5889dff with theState.cpphunk reverted: it fails with second-target pixel (32, 0) outside the unsplit draw's 32-pixel render extent holding 0xad4a669f (it held 0x2e2a2620). The paired run of 5889dff had the same result as the table above without_counting_query(13/13 on head, 22 layer-insert lines per run, 0VUID-lines).On 01d6097 (test only), the new entry
agc_driver_late_test_merge_split_counting_queryruns--counting-query: after the background depth draw it callsRecorder::Active()->CountSamples()under the GPU mutex, then submits the same killing, LEQUAL, depth-writing draw into the 11_11_10 target and the additively blended RGBA8 target, with a shader that writes no memory and with no sample mask export or quad mask. Like_mask_exportand_quad_mask, it runs underAPS5_SKIP_REFUSED_DRAWS=1and checks that the draw left depth (by the depth probe) and both targets unchanged. The stock_counting_pixeland_counting_vertexcases do not reach theCountingSamplesgate, because their shaders write memory and thewritesMemorycondition already prevents the split. On MoltenVK all 9agc_driver_late_test_merge_splitentries pass in each of 3 runs. Control, 01d6097 without theCountingSamples()check inLateTestMergeSplitTargets: only_counting_queryfails, the merge pass aborting ona partial write of a packed color target merges inside the pixel shader after early depth and stencil tests, which a shader that kills pixels under late tests cannot use while occlusion queries count samples; the other 8 entries pass. On the RTX 4090 it is part of the table above. Control on the 4090, 01d6097 with the same check removed:_counting_queryfails with the same message, under the validation layer.On 62f116b (head), the new entry
agc_driver_late_test_merge_split_pending_mergeruns withAPS5_ASYNC_DRAW_COMPILE=1andANYPS5_NO_SHADER_CACHE=1. It submits the killing, depth-writing ALWAYS split draw into the 11_11_10 target next to an additively blended RGBA8 target, resetting both targets before each of up to 400 attempts. Each attempt must change both targets or neither, and the first attempt must not draw, since its passes are still compiling. When the draw lands, the 11_11_10 target must match the CPU reference bit for bit and the RGBA8 target within 1 per channel. On MoltenVK, the 10agc_driver_late_test_merge_splitentries andagc_driver_graphicspass 11/11 in each of 3 runs. Control on MoltenVK,Draw.cppreverted to 01d6097 with the test kept: it fails 3 of 3 runs withdrew only its depth pass (the RGBA8 target changed, the 11_11_10 merge target did not) on attempt 4. On the RTX 4090 it is part of the table above, with the revert control described there.On 704f9bf (c26a94d plus the export and quad-mask check), Apple M5 Max, macOS 27.0.1, x86-64 build under Rosetta 2, Release, Khronos validation layer (Vulkan SDK 1.4.363.0) on a local MoltenVK 1.4.2 build and on the SDK's MoltenVK:
agc_driver_late_test_merge_splitand its counting-pixel, counting-vertex, depth-clear, mask-export and quad-mask entries, plusagc_driver_graphics, pass 3 of 3 on each driver, with 36Insert instance layerlines and noVUID-line. One of the threeagc_driver_graphicsruns on the local MoltenVK failedtwo ranges under a budget for two were not imported(BdaResources.cpp, perf(agc): retry hot heap mirrors as host imports behind a switch boykopovar/AnyPS5#22438's host-import budget check, withvkAllocateMemoryfailing on a loaded machine) and passed 3 of 3 on a rerun; the split code is not on that path.On 704f9bf, RTX 4090 (NVIDIA 621.14, Windows 11, WinLibs GCC 15.2.0, Release) under the validation layer (Vulkan SDK 1.4.363.0,
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V --repeat until-fail:3): the sixagc_driver_late_test_merge_split*entries,agc_driver_graphics,agc_driver_packed_float_blend,agc_driver_packed_unorm4444_partial_write,agc_driver_sample_mask_drawandagc_driver_stencil_known_replacepass 11/11 three times, 54Insert instance layerlines, nowas not found but was requested by env var VK_INSTANCE_LAYERS, noVUID-line; the only validation messages are 90Undefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings.mainf281831 on the same box passes the 5 of these it has three times, 18 layer lines, noVUID-line, 60 of the same warnings; the 30 more on this head come from the split test.The two new entries,
agc_driver_late_test_merge_split_mask_export(DB_SHADER_CONTROL0x140,SPI_SHADER_Z_FORMAT9) andagc_driver_late_test_merge_split_quad_mask(PA_SC_AA_MASK_X0Y0_X1Y00x0000ffff), run withAPS5_SKIP_REFUSED_DRAWS=1: a background depth draw, the refused draw beside an additively blended RGBA8 second target, then a probe that passes only where depth is unchanged. Every pixel must hold the probe's color and the second target its old value. Control, 704f9bf without the new line inLateTestMergeSplitTargets: both fail withpixel (0, 0) holds 0x700d0180 (expected 0x780e01a0 from the probe, so the refused draw wrote depth) and 0x9f40609f in the second target (it held 0x20202020), andagc_driver_graphicsfails on its new depth export case.tests/Graphics.cppchecks that a depth, stencil or sample mask export, a quad pixel mask and a partial quad sample mask each stop the split.On b6e35a0 (
main1136efb merged), Apple M5 Max, macOS 27.0.1, x86-64 under Rosetta 2, Release, Khronos validation layer (Vulkan SDK 1.4.363.0) on a local MoltenVK 1.4.2 build and on the SDK's MoltenVK:agc_driver_late_test_merge_splitand its counting-pixel, counting-vertex and depth-clear entries, plusagc_driver_graphics, pass 3 of 3 on each driver, noVUIDmessages.On dc3f7e7 (
main1c4a047 merged in 6a2e0ee, plus theshaderStorageImageReadWithoutFormatskip), RTX 4090 (NVIDIA 616.92, Windows 11 10.0.26200.9711, WinLibs GCC 15.2.0, Release), compared withmain1c4a047 on the same build directory. Under the validation layer (Vulkan SDK 1.4.363.0,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V), every ctest entry of the focused targets (agc_driver_graphics,agc_driver_late_test_merge_split,agc_driver_packed_float_blend,agc_driver_packed_float_color_target, the 4_4_4_4 color target and partial-write tests,agc_driver_layered_array_color_draw,agc_driver_unclamped_normalized_blend,agc_driver_depth_export_clamp,agc_driver_key_miss,agc_driver_sample_mask_draw,agc_driver_stencil_known_replace,request_serializer,agc_shader_memory,agc_shader_disk_cache,agc_driver_pipeline_journal) passes 97/97 on this head and 93/93 onmain(which lacks the four split entries); 215 and 175Insert instance layerlines, nowas not found but was requested by env var VK_INSTANCE_LAYERS, noVUID-line on either (the threepAttachments-00605errors of the two-target case are gone since fix(agc): enable independentBlend for color targets with different blend states boykopovar/AnyPS5#6782 is inmain). The only validation messages areUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings, 40 on this head and 30 onmain, the 10 more from the split test.ctest -R agc -j4: 1572/1579 on this head, 1568/1575 onmain, the same 7 tests failing on both (agc_driver_msaa_dcc_clear_{2,4,8},agc_driver_image_plane_address_on_linefix(test): compare linear-mip 1D samples only against DIM 1D boykopovar/AnyPS5#6221,agc_driver_image_sample_lod_clamp,agc_driver_image_sample_lod_clamp_shader_lane,agc_driver_native_depth_publication).agc_driver_late_test_merge_splitwith--repeat until-fail:5: 5/5.Lucke0051 ran 65ad383 merged onto
mainon an RTX 3070 Ti and an Intel UHD Graphics 630 (Mesa 26.2.6): no difference frommainon the NVIDIA GPU; on the UHD 630agc_driver_late_test_merge_splitaborted because the device lacksshaderStorageImageReadWithoutFormat, which the merge pass needs, so dc3f7e7 makes the test skip there, the same check test(agc): skip packed float blend and sparse levels without the features they need boykopovar/AnyPS5#16984 adds toPackedFloatBlend.cpp.On 8872e28 (the merge of feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's head aa1d452,
mainee9a9a6 under it, plus 8eb63a2 and 8872e28), RTX 4090 (NVIDIA 616.92, Windows 11), each test run three times: feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's 75 ctest entries plus the fouragc_driver_late_test_merge_splitones, the newagc_driver_late_test_merge_split_depth_clearamong them, pass 79/79, and 79/79 under the validation layer with the same messages as before: the threeVUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605errors of the two-target case (AGC: pipelines use differing per-attachment blend states while independentBlend is never enabled (VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605) boykopovar/AnyPS5#11990, which fix(agc): enable independentBlend for color targets with different blend states boykopovar/AnyPS5#6782 fixes) and theUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings. Control: 8872e28 without the depth-clear line inLateTestMergeSplitTargetsfailsagc_driver_graphics(a partial 4_4_4_4 write that kills under late tests split while DB_RENDER_CONTROL clears depth) andagc_driver_late_test_merge_split_depth_clear(the merge pass of a late-test merge split still writes depth or stencil). The label-recapture retry has no regression test: no draw can reach it and split today (see the comments).After merging feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's head 237ede9 (which merges
mainbb04a4f; head 829eb0d), RTX 4090, each test run three times: feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's 72 ctest entries plus the threeagc_driver_late_test_merge_splitentries pass 75/75, and 75/75 under the validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V): 145Insert instance layerlines, nowas not found but was requested by env var VK_INSTANCE_LAYERS, 49Undefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings. The layer reportsVUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605three times, from the new two-target case, whose attachments have different blend states whilemainnever enablesindependentBlend(AGC: pipelines use differing per-attachment blend states while independentBlend is never enabled (VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605) boykopovar/AnyPS5#11990). With fix(agc): enable independentBlend for color targets with different blend states boykopovar/AnyPS5#6782 merged on top, the three split-test entries pass under the layer with noVUID-line.mainbb04a4f passes feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's 71-entry set in both runs, noVUID-line.The two-target case: two of the cases also bind an RGBA8 target in slot 1 that blends additively (ONE + ONE), with
CB_TARGET_MASK0xff, and require each pixel the kill keeps on the right half to hold its old value plus the color once and every other pixel to be unchanged. Control: with the merge pass keeping every target bit, the test fails withsecond-target pixel (32, 0) drawn by the depth pass holds 0xff6aa6ff (it held 0x2e2a2620), the color added twice.tests/Graphics.cpp(before 704f9bf): the split decision over the nine existing 4_4_4_4 depth, stencil and depth-bounds cases withKILL_ENABLEset: only the one that tests and writes depth splits, and none splits without a kill; no split for a stencil write, ZFUNC NEVER orDEPTH_BEFORE_SHADER; a merged target in slot 1 splits onCB_TARGET_MASKbits 4..7.tests/execution/LateTestMergeSplit.cpp(new), through DCB submission: a 64x16 tiled 11_11_10 target over a Z32 depth target. A background depth draw, an occluder over the left half, then the split draw (a checkerboard kill, premultiplied-alpha blend), then a probe with the same compare and no depth write. Checked bit for bit on every pixel against a CPU reference: behind the occluder unchanged, kept pixels blended once, killed pixels covered by the probe, so they wrote no depth. LESS, GREATER and GEQUAL, two rounds each (the second through the caches). With the split disabled the test stops on the refusal above.RTX 4090 (NVIDIA 616.92, Windows 11, WinLibs GCC 15.2), head 7df24ce:
agc_driver_graphics,agc_driver_late_test_merge_split,agc_driver_packed_float_blend,agc_driver_packed_unorm4444_partial_write,agc_driver_packed_unorm4444_multisample_partial_write,agc_driver_sample_mask_draw,agc_driver_stencil_known_replaceandagc_driver_layered_array_color_drawpass.After merging feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's
mainmerge (head 7e67a54, onmain7e69be6), RTX 4090: the 52 ctest entries of feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's focused targets plusagc_driver_late_test_merge_split_tests,agc_driver_sample_mask_draw_testsandagc_driver_stencil_known_replace_testspass 52/52, each test run three times (ctest --repeat until-fail:3).Validation layer:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0),ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1withctest -V, onmain83462cc (7e69be6 plus eight commits totools/only) (48/48:mainlacks the split test and feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's three) and on this head (52/52). Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS, and neither has aVUID-line. The layer's only messages on this head areUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings from the merge tests, where the merged target has no color attachment and the fragment output goes unused: 10 inagc_driver_late_test_merge_split, and feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's 29.mainlogs no validation message in its 48.After merging feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's new head 634b3dc (which merges feat(agc): merge partial writes into 4_4_4_4 UNORM color targets boykopovar/AnyPS5#8564's head d201de3 and
main2259f05), head be2546e on the RTX 4090: feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's 56 focused ctest entries plusagc_driver_late_test_merge_split_tests,agc_driver_sample_mask_draw_testsandagc_driver_stencil_known_replace_testspass 59/59, each test run three times; under the validation layer 59/59 with noVUID-line (the 29 warnings of feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's merge tests plus 10 from the split test, allUndefined-Value-ShaderOutputNotConsumed-DynamicRendering). The packed merge refusals entry inshader.mdnow sits where feat(agc): merge partial writes into 4_4_4_4 UNORM color targets boykopovar/AnyPS5#8564 moved it, with this PR's narrowing (a kill under late tests throws for a stencil write; a depth write is split).After merging
main0db47b2 (perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE) boykopovar/AnyPS5#6946's draw finisher pipeline among it), head bb446b7 on the RTX 4090: the same 59 ctest entries pass 59/59, each test run three times, and 59/59 under the validation layer with noVUID-line (the same 39Undefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings); withAPS5_DRAW_PIPELINE=1,agc_driver_late_test_merge_split,agc_driver_packed_float_blendandagc_driver_packed_unorm4444_partial_writepass 3/3, each run three times.main0db47b2: 54/54 and 54/54 under the layer, noVUID-line. The split check runs indrawbefore a draw is handed to perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE) boykopovar/AnyPS5#6946's finisher, which receives the decoded state of each pass, so restoring the two registers after each pass is unaffected.After merging feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's new head 6806092 (feat(agc): merge partial writes into 4_4_4_4 UNORM color targets boykopovar/AnyPS5#8564's head 3a66884 and
main513ca7e under it) andmain58ceeb8 (head de1a81f; the only conflict was an include line in the driver'sDraw.cpp), RTX 4090: the 61 ctest entries the same targets now select (mainadded two) pass 61/61, each test run three times, and 61/61 under the validation layer with noVUID-line (the same 39 warnings); withAPS5_DRAW_PIPELINE=1the split test and feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's blend and partial-write tests pass 3/3.tests/execution/LateTestMergeSplit.cppgets two modes, ctestagc_driver_late_test_merge_split_counting_pixelandagc_driver_late_test_merge_split_counting_vertex. A draw without a merge first shows the shader adds to a buffer counter (buffer_atomic_add); then the split draw with the same shader must throw the late-test refusal and leave the counter as it was. Control, this head withDraw.cppas it was before 4768b4a: the vertex case is split and drawn twice, and the pixel case draws the depth pass, then stops on feat(agc): merge partial writes into 4_4_4_4 UNORM color targets boykopovar/AnyPS5#8564's memory-write refusal in the merge pass.After merging feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's head 5e04550 (
main379b1dc under it) and adding 4768b4a, RTX 4090: the 64 ctest entries the same targets now select, both counting modes among them, pass 64/64, three times each, and 64/64 under the validation layer with noVUID-line (the same 39 warnings); withAPS5_DRAW_PIPELINE=1, the split test, both counting modes and feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's blend and partial-write tests pass 5/5, three times each.After merging feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020's head 5f72874 (
main732ab06 under it; journal format 11, disk cache 49), head 976fc9c:main's draw tracing givesdraw()the packet offset, sodrawLateTestMergeSplittakes it too and passes it to both passes, andmain's new verdict names gainSplit. RTX 4090: the 70 ctest entries the same targets now select pass 70/70, three times each, and 70/70 under the validation layer with noVUID-line (the same 39 warnings). Control, this head with the memory-write check removed fromDraw.cpp(3c14784ba): both counting modes fail, the vertex case split and drawn twice and the pixel case stopped on feat(agc): merge partial writes into 4_4_4_4 UNORM color targets boykopovar/AnyPS5#8564's memory-write refusal.main3af09d9 passes the 66 entries it has, also under the layer with noVUID-line. The head also merges cleanly withmain504ea3b.Gran Turismo 7 (PPSA01317) on the RTX 4090, with 4768b4a's check on the local integration branch of the GT7 runs (
mainof 10/23 plus the PRs the title needs) and a local print of each split candidate's programs. In run ui-4, the first 200 candidates were all the World Map's alpha-tested draw, vertex program 0x126bcefb00 and pixel program 0x126bcf0300.ProgramWritesMemoryis false for both, so the draw still splits, and the load went past the World Map tounsupported tessellation built-in, which this PR doesn't touch.Besides the merge, the two-pass draw's debt sentences moved from the packed merge refusals entry in
shader.mdto an entry of their own inlibSceAgcDriver.md, which keeps the first entry under the 1000-character limit.Gran Turismo 7 (PPSA01317 01.710.000) on the RTX 4090, with this commit on a local integration branch (feat(agc): blend into 11_11_10 float color targets in the pixel shader boykopovar/AnyPS5#9020 before its
mainmerge, fix(shader): link table callees that together exceed s_call_b64 range boykopovar/AnyPS5#9068's two fixes, fix(agc): raise no end-of-pipe event from flips and carry the release's interrupt context boykopovar/AnyPS5#7978, fix(agc): write a replace blend into a packed color target without blending boykopovar/AnyPS5#7243, feat(agc): render layered draws into a depth view of several slices boykopovar/AnyPS5#7256, fix(shader): answer image_get_resinfo on any T# dimension boykopovar/AnyPS5#7550, and three local changes: one draws a partially resident depth target whose pages are all committed, one skips the compute dispatches refused in Recompiler: a T# reached through two loads after a dynamically indexed read (pointer → pointer → T#, pointer → V# → buffer → T#) stops Ratchet & Clank (PPSA01474) and Guardians of the Galaxy (PPSA01748) boykopovar/AnyPS5#6191, one draws dithered alpha-to-mask as undithered). The World Map's alpha-tested draw into the 11_11_10 target with pixel shader 0x126bcf0300 (GEQUAL with depth writes, no stencil) used to stop the load on the refusal above. It now draws through the split, and the load goes on tocolor targets with fewer fragments than samples (EQAA) are unsupported(4 samples, 2 fragments, 512x512), which this PR doesn't touch.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)mainSummary by CodeRabbit