Repository navigation
feat(agc): draw one-sample color targets beside a multisampled depth target with sample 0's coverage - #8115
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.
|
|
Tested on RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU ( AI-assisted: yes (Claude Code). |
|
@TheSovietWaffle thank you for running these on two vendors. The AMD run is the first one this PR has had: until now the AI-assisted: yes (Claude Code) |
|
@milescoviello the
So the |
|
@thuanquang thank you, this settles the AMD question. The vulkaninfo check plus the missing AI-assisted: yes (Claude Code) |
|
A short addition: results on current Setup: Windows 11 (26300), WinLibs GCC 15.2.0, Release,
AI-assisted: yes (Claude Code); results above were run on this machine. |
|
Thanks @wachi35676. That's the first Blackwell run, and it confirms the paths #8172 touched still pass on top of it. I added it to the description. AI-assisted: yes (Claude Code) |
7e5351d to
06f707b
Compare
|
@milescoviello thanks for the rebase. Since then #7869 merged at 10:48 UTC and added
Could you rebase onto current main, set the assert to 792 and |
|
@oneandonlydean yes, I hit both a few minutes ago. The branch is rebased onto #6612, #6639, #8365 and #8542 took 6 as well. They're rebased onto the same AI-assisted: yes (Claude Code) |
06f707b to
7d21592
Compare
|
Pushed AI-assisted: yes (Claude Code) |
|
@milescoviello the full CI run on The test passes on The fix we'd expect is in the test only. Before drawing, One more note for the Tested section: llvmpipe has neither |
|
@oneandonlydean thanks, agreed on all counts. It's queued to build and run under lavapipe and on the 4070 Ti, after the title run that has the machine now. I'll push when it passes. On the Tested note: the truncated path does run on this machine. The RTX 4070 Ti has AI-assisted: yes (Claude Code) |
|
Pushed AI-assisted: yes (Claude Code) |
… counts An overrasterized draw (a multisampled rasterizer into one-sample color targets, VK_NV_framebuffer_mixed_samples) chains VkAttachmentSampleCountInfoNV into its pipeline. When the pipeline is linked from graphics pipeline libraries, only the fragment output library carried it, and the link and the background link-time-optimized relink did not. The Khronos validation layer (1.4.363) then reports VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285 for every such draw, as it does in agc_driver_pixel_sample_coverage, and not with APS5_NO_GPL=1, where the pipeline is built whole. Both links now chain a copy of the sample counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reate info Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…target with sample 0's coverage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…targets ExpectTruncated draws with a two-sample D32 depth target. On a device whose framebufferDepthSampleCounts lacks 2, as lavapipe, the pipeline's existing sample count check refused that depth target before the truncated coverage check, and the test failed. The case now reports why it was not tested: no two-sample depth targets, or neither mixed sample extension with truncated coverage reduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2620f8d to
4ba0175
Compare
Pipeline creation and SPIR-V validation read State::vertexPoints and the three point sizes, so the pipeline journal's recipe codec and canonical state now carry them, the State layout guard names its new size and the journal format becomes 8 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869 and 7 for the truncated coverage of boykopovar#8115). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 9 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115 and 8 for the point lists of boykopovar#6801). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 9 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115 and 8 for the point lists of boykopovar#6801). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 9 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115 and 8 for the point lists of boykopovar#6801). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 9 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115 and 8 for the point lists of boykopovar#6801). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 10 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115, 8 for the point lists of boykopovar#6801 and 9 for the 4_4_4_4 UNORM target merges of boykopovar#8564). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 12 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115, 8 for the point lists of boykopovar#6801 and 9 for the 4_4_4_4 UNORM target merges of boykopovar#8564; open pull requests use 10 and 11). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 12 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115, 8 for the point lists of boykopovar#6801 9 for the 4_4_4_4 UNORM target merges of boykopovar#8564 and 10 for the colour logic operation of boykopovar#9348; boykopovar#8365 uses 11, and the number is set to main+1 when this lands). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 12 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115, 8 for the point lists of boykopovar#6801 9 for the 4_4_4_4 UNORM target merges of boykopovar#8564 and 10 for the colour logic operation of boykopovar#9348; boykopovar#8365 uses 11, and the number is set to main+1 when this lands). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline journal guards State and ShaderStages, which this branch extends. The recipe codec and canonical state now carry the hull wave size, the geometry stage after tessellation, the merged hull flag (TessellationConfiguration keeps its size, so its guard can't see it) and rasterizer discard, and the journal format becomes 12 (main took 5 for the recipe codec change of boykopovar#5656, 6 for the polygon modes of boykopovar#7869, 7 for the truncated coverage of boykopovar#8115, 8 for the point lists of boykopovar#6801 9 for the 4_4_4_4 UNORM target merges of boykopovar#8564 and 10 for the colour logic operation of boykopovar#9348; boykopovar#8365 uses 11, and the number is set to main+1 when this lands). A draw's tessellation capture validates against that draw's capture buffers, which a replay doesn't have, so it isn't journaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
DecodeStaterefuses a draw that writes a one-sample color target beside a multisampled depth target: "a color target's sample count differs from the rasterizer's". The only one-sample color target it accepts under a multisampled rasterizer is merged coverage (overrasterization with no depth target), drawn throughVK_NV_framebuffer_mixed_samples.Ghost of Tsushima (PPSA02225) stops on such a draw. A diagnostic build logged its state: a one-sample
R8G8B8A8_UNORMcolor target (CB_COLOR0_ATTRIB0) and a 2xD32_SFLOAT_S8_UINTdepth/stencil target (DB_Z_INFO.NUM_SAMPLES1), 1920x2160, withPA_SC_AA_CONFIG0x108001 (2 samples),MSAA_ENABLEset andDB_EQAA0. Once that draw passed, a later draw into the same targets addedPS_ITER_SAMPLE(PA_SC_MODE_CNTL_10x6030000) and a sample-interpolated input.AMD's own Vulkan extension for this case,
VK_AMD_mixed_attachment_samples, says "all samples are depth/stencil tested, but only the first color sample count number of samples get a corresponding color output". For one color sample, the pixel's color is written when rasterizer sample 0 is covered and passes the depth and stencil tests. WithPS_ITER_SAMPLEevery sample's invocation runs and is tested, and the color is sample 0's output.VK_NV_coverage_reduction_mode'sTRUNCATEmode gives the same mapping ("raster sample i maps to color sample i"). It is also the rule the existing debt entry for a one-sample target under a multisampled rasterizer already takes from the AMD extension.StategetstruncatedCoverage. It is set for a one-sample color target when the depth target has the rasterizer's sample count (more than 1), the draw isn't overrasterized, and every color target is one-sample. A pixel shader that runs per sample keeps doing so.TRUNCATEcombinations fromvkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNVwith one color sample and depth/stencil samples equal to the rasterizer's, or, without the NV extensions,VK_AMD_mixed_attachment_samplesfor every depth and color sample count.VkAttachmentSampleCountInfoAMD/NVthe depth sample count, and on NVIDIA it addsTRUNCATEcoverage reduction. Without either extension, the draw throws a message naming them.polygonModeonmain,sizeof(State)becomes 792, and the journal'sFileFormatgoes to 7 (main's perf(agc): data-only draw hits compare only the user words a stage reads #5656 took 5 and feat(agc): draw point and line polygon modes #7869 took 6).Stacked on #7985, which keeps
VkAttachmentSampleCountInfoNV(with its depth/stencil count) when a pipeline is linked from libraries.Tested
mainf6075c2 as4ba0175ba2, after feat(agc): expose expanded FMASK for tracked native owners #7948 grewStatefrom 784 to 800 bytes. The one conflict was the size check inPipelineJournal.cpp, now 808:main's 800 plus this PR's 8. The build confirms it. On that head (Ubuntu 26.04.1, GCC 15.2, RTX 4070 Ti, 615.71.09):^agc_driver_graphics$|pixel_sample|pipeline_journal|pipeline_library|sample_count|mixed|msaa|multisamplepass 3 of 3.mainand on this head.mainreportsVUID-vkCmdDraw-multisampledRenderToSingleSampled-07285twice, both fromagc_driver_multisample_fill_host_only; this head reports none, and nothing new.test/ghost-9742-9717(3ec696f: fix(agc): import native multisample D32S8 targets with a separate stencil plane and a depth-only HTILE #9533, fix(agc): accept a colour alias over a native multisample depth plane when HTILE proves its clear #9742 and feat(agc): sample the stencil plane of a native multisampled D32S8 target #9717), release libs, 20 GiB cap. Without this PR, warm and cold runs stop 246 s and 254 s in ona color target's sample count differs from the rasterizer's. With it merged (2620f8d), that refusal is gone, and both runs go on to fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample color target #8121's case (a one-sample color target under a multisampled rasterizer without MSAA_ENABLE ...), 146 s and 267 s in. With fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample color target #8121 as well, both reach the 600 s limit with no refusal (comment).Ubuntu 24.04, GCC 13.3, Release, NVIDIA RTX 4070 Ti (595.99.02). The driver reports
TRUNCATEandMERGEwith one color sample and depth/stencil samples equal to the rasterizer's for 2 and 4 samples.2620f8d62e, for the llvmpipe CI failure @oneandonlydean found:ExpectTruncatednow skips withtruncated coverage not tested: the device has no two-sample depth targets (framebufferDepthSampleCounts)whenframebufferDepthSampleCountslacks 2, as on lavapipe, wheremain's depth sample count check refused the draw first. Under lavapipe (llvmpipe, LLVM 20.1.2),agc_driver_pixel_sample_coverageprints that line and passes 3 of 3, and the 33 tests pass. On the RTX 4070 Ti the truncated case still runs and passes, and the 33 pass 3 of 3. No CI lane reaches the truncated path: llvmpipe has neither mixed-sample extension and the Windows runner has no GPU. Its evidence is this card (VK_NV_framebuffer_mixed_samples) and @thuanquang's AMD run (VK_AMD_mixed_attachment_samples).main275e896 (7d215928d1), after perf(agc): data-only draw hits compare only the user words a stage reads #5656 and feat(agc): draw point and line polygon modes #7869 had each taken a journal format. Thesizeof(State)assert is now 792 andFileFormat7, and the 33 tests matchingpixel_sample_coverage|pipeline_journal|pipeline_library|^agc_driver_graphics$|sample_count|mixed|msaa|multisamplepass 3 of 3.agc_driver_graphics, new cases inmultisampledDepthTests:PS_ITER_SAMPLEand the sample-interpolated input from the second draw runs per sample with sample 0's color. With a 4x color target it is still refused.agc_driver_pixel_sample_coverage, new truncated case. Two half-covering triangles are drawn at 2x beside a 2x depth target, writing theirSAMPLE_COVERAGEmask into a one-sample target. With the standard 2x locations, one triangle's edge pixels cover only sample 0 and the other's only sample 1. The test requires that pixels covering only sample 0 are written and that no pixel covering only sample 1 is.PS_ITER_SAMPLE, writing each invocation's sample index fromANCILLARY. Every written pixel must hold sample 0's 0, and it must write exactly the pixels the first case wrote.agc_driver_graphics.MERGEinstead ofTRUNCATE(7d2c2c867b) fails with "32 pixels that cover only sample 1 were written into the one-sample target".mainf9012ee against it with 7e5351d merged, with the Khronos validation layer.vulkaninfolistsVK_AMD_mixed_attachment_samplesand neither NVIDIA extension, soVulkanDevicetakes the AMD branch.agc_driver_pixel_sample_coverage -Vprints the merged-coverage skip but nottruncated coverage not tested, so the truncated-coverage checks ran through the AMD extension, and they pass 3 of 3.agc_driver_graphicspasses 3 of 3 with and without this PR. Neither side has aVUID-message or reports the layer missing.agc_driver_graphicsandagc_driver_pixel_sample_coveragepass 3 of 3 on an NVIDIA RTX 3080 (617.42) and on an AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002). That run did not use the validation layer or a title.main02fb1ce (with fix(agc): keep resident DCC targets watched under aligned block imports #8172) with 7e5351d merged.agc_driver_graphics,agc_driver_pixel_sample_coverage,agc_driver_msaa_dcc_stateandmsaa_dcc_clear_{2,4,8}pass 3 of 3 on each GPU. On the RTX 5070 Ti both coverage cases ran through the NV extensions, and on the iGPU the truncated case ran throughVK_AMD_mixed_attachment_samples. A related set of 62 tests passes on each GPU.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_graphics$|pixel_sample|multisample|msaa|sample_mask|alpha_to_coverage|depth' -Von fix(agc): copy a linked pipeline's color sample counts only when it has color attachments #7985's head c46005c and on this PR (7e5351d). 54 of 54 pass on each, neither log reports the layer missing, and neither has aVUID-error.ctest -R '^agc_'(before the per-sample case was added): 802 of 803 pass.agc_driver_storage_read_during_idle_storeis a newer test onmainthat this tree doesn't have; it shows asNot Run.mainwith the PRs it needs to reach these draws (fix(libScePlayGo): list chunks 0 to 999 when only a scenario file is present #7726, fix(agc): draw a stencil replacement against a known stencil value as an inversion #7725, fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample depth target #7729, feat(agc): import cleared native multisample D32S8 targets and whole HTILE fills #6300 rebased, fix(agc): copy a linked pipeline's color sample counts only when it has color attachments #7985 and a local separate-stencil-plane change). Without this PR it stops 62 s in on the first draw above. With the first version of this PR (no per-sample case) it ran to 147 s and stopped on the second draw. With this head it stops 55 s and 70 s in (two runs) at another refusal, a one-sample color target withoutMSAA_ENABLEunderPS_ITER_SAMPLE, which is a separate rule. Those runs ended before the point where the second draw came up, so in the title only the first draw is confirmed past; the per-sample decode and GPU cases above cover the second.tools/check_conventions.py --base upstream/mainpasses. One warning remains: the existing "Single-sample scan into a multisampled depth target" entry is over 1000 characters, and this PR only shortens it.Not tested: RADV, and a title on AMD. The
VK_AMD_mixed_attachment_samplespath has run on AMD's Windows driver (@thuanquang's run above).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