Repository navigation
feat(agc): draw point and line polygon modes - #7869
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.
|
fogydes
left a comment
There was a problem hiding this comment.
Verified the diff, conventions, and test coverage in PR #7869:
- State Decode & Pipeline Keys:
State.cppcorrectly decodes non-culled face modes whenPOLY_MODE = 1, maps front/back point and line primitives toVK_POLYGON_MODE_POINT/VK_POLYGON_MODE_LINE, and propagatespolygonModethrough pre-rasterization library keys, full-pipeline keys, draw keys, and pipeline journal format 5. - Device Capabilities: Appropriately requests
fillModeNonSolidinVulkanDevice.cppwhen supported and leveragesVK_KHR_maintenance5to default unwrittenPointSizeto 1.0. - Technical Debt & Unsupported Configurations: Accurately records edge cases in
docs/dev/debt/libSceAgcDriver.md(differing front/back modes with two-sided rasterization, variable line/point widths, depth bias with non-solid modes). - Conventions & Tests: Zero code comments introduced. Unit test fixtures added in
tests/Graphics.cppand execution coverage intests/execution/PolygonModeDraw.cpp.tools/check_conventions.pypasses with 0 findings.
|
Windows and AMD's own driver. AMD Radeon 860M (RDNA 3.5,
The control keeps this PR's headers, since the tests read AI-assisted: yes (Claude Code) |
|
Title data: CUSA03312, through #6977's PS4 path, draws the triangle strip of its first frame with AI-assisted: yes (Claude Code) |
|
@savvaniss one small change before CI: main's |
PA_SU_SC_MODE_CNTL with POLY_MODE set to a point or line type was refused, and every triangle was drawn filled. The state decode now takes the polygon type of the faces that are not culled into State::polygonMode, ignores the types when POLY_MODE is clear or the primitives are points or lines, and keeps refusing front and back types that differ while both faces are drawn. Points are drawn one pixel wide (PA_SU_POINT_SIZE 0x00080008 inside PA_SU_POINT_MINMAX), the size VK_KHR_maintenance5 gives a point whose shader does not write PointSize, and lines one pixel wide (PA_SU_LINE_CNTL). The device enables fillModeNonSolid and maintenance5 when they are available. The polygon mode joins the pipeline, library and draw keys and the pipeline journal (format 5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's journal format is already 5, so this branch's bump to 5 no longer marks the journals written before its polygon-mode field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4268752 to
863167d
Compare
|
@oneandonlydean done. The journal On the RX 9070 XT, with the validation layer, all of these pass with no
AI-assisted: yes (Claude Code) |
|
@savvaniss thanks, |
|
Re-checked the new head: the only change is the journal |
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 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). 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 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). A pipeline drawn with a 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>
Module records are SPIR-V and take almost all of a journal's bytes, so APS5_PIPELINE_JOURNAL_MAX_MIB fills with modules and later pipelines are not recorded (boykopovar#8309). A module record now keeps its identity, stage and encoded size, followed by a zstd frame (level 1) of the encoded result; loading and replay expand it before decoding. The journal format becomes 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). 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 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). A pipeline drawn with a 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>
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 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). 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 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). A pipeline drawn with a 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>
Module records are SPIR-V and take almost all of a journal's bytes, so APS5_PIPELINE_JOURNAL_MAX_MIB fills with modules and later pipelines are not recorded (boykopovar#8309). A module record now keeps its identity, stage and encoded size, followed by a zstd frame (level 1) of the encoded result; loading and replay expand it before decoding. The journal format becomes 7 (main took 5 for the recipe codec change of boykopovar#5656 and 6 for the polygon modes of boykopovar#7869). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The AGC driver drew every triangle filled and threw on any
PA_SU_SC_MODE_CNTLwithPOLY_MODEset to a point or line type ("polygon mode, depth bias or nonstandard rasterization is unsupported"). This PR draws those triangles with Vulkan's point and line polygon modes.State.cpp):POLY_MODE = 1takesPOLYMODE_FRONT_PTYPE/POLYMODE_BACK_PTYPE(0 points, 1 lines, 2 filled) from the faces that are not culled, into a newState::polygonMode.POLY_MODE = 0both types are ignored, as the hardware ignores them, and point and line primitives ignore them too.Pipeline.cpp):polygonModegoes into the rasterization state, the pre-rasterization library key and the whole-pipeline key. It is also added to the draw keys and the pipeline journal (format 5).VulkanDevice.cpp):fillModeNonSolidis enabled when the GPU has it.VK_KHR_maintenance5is enabled with the pipeline-library extensions, so an unwrittenPointSizeis 1.0.PA_SU_POINT_SIZE = 0x00080008withinPA_SU_POINT_MINMAX), or with a per-vertex size;PA_SU_LINE_CNTL);POLY_MODEor polygon type.#7275 adds the same
fillModeNonSoliddevice flag, under the same name, for its forced wireframe. Whichever of the two merges second keeps one copy.The first triangle strip Hasbro Family Fun Pack (CUSA03312) draws, through the PS4 path of #6977, sets
PA_SU_SC_MODE_CNTL = 0x8: points for both faces.Tested
Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release. RX 9070 XT (driver 32.0.31041.1004) and UHD 770 (driver 32.0.101.7088).
agc_driver_graphics, decode:POLY_MODE;agc_driver_polygon_mode_draw, on each GPU: a triangle with corners on pixel centres in a 64×16 target.ctest --parallel 4, full suiteVkCacheemptied firsta8dd777a0;9f446e404only shortens the debt entry)agc_driver_image_table_vouched_lookupsandagc_driver_sample_multisample_targetfail, as onmain(#6957)device-faultlinesThe AMD run leaves out the three
APS5_NO_GPLtests. Until #7828 merges, they fault the GPU onmainin a parallel AMD run (#7809).agc_driver_graphics,agc_driver_polygon_mode_draw,agc_driver_conservative_rasterizationandagc_driver_inactive_vertex_point_sizealso pass 3 times in a row on each GPU.Validation: Khronos validation layer 1.4.363 (Vulkan SDK),
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ctest -R <tests> -V, onmaincded26c68and on this PR merged into it, on both GPUs (AMD driver cache emptied first). Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS. Tests:agc_driver_graphics,agc_driver_conservative_rasterization,agc_driver_inactive_vertex_point_sizeand this PR'sagc_driver_polygon_mode_draw. No validation message at all, onmainor with this PR, on either GPU.Risk (CUSA03312), 20 Oct: its first frame still needs this change. With it in the stack of Hasbro Family Fun Pack (CUSA03312) #7198 (on an RX 9070 XT), Risk goes on to play a local match against the AI.
21 Oct: rebased onto
mainb77bd5880, and the pipeline journalFileFormatset to 6, the next number aftermain's 5. WithANYPS5_GPU=AMD,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the validation layer on the RX 9070 XT, these all pass with noVUID-line:agc_driver_graphics,agc_driver_polygon_mode_draw,agc_pipeline_journal,agc_pipeline_journal_long_pathsandagc_pipeline_journal_extended_paths.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