Repository navigation
feat(agc): fast clear the CMASK of array and layered color targets - #8065
Closed
ArielWolle wants to merge 7 commits into
Closed
ArielWolle wants to merge 7 commits into
ArielWolle wants to merge 7 commits into
Conversation
A draw whose vertex shader exports the render target array index into a color view of several slices of a 2D array target was refused. The view now renders layers lastSlice - slice + 1 through a 2D array attachment view of the array's resident image starting at its first slice, and the draw marks every rendered slice dirty. A view of several slices of a surface that is not a 2D array is still refused, as is a layered draw without the array's resident image. AI-assisted: yes
…of its view's slices A layered draw into a color view of slices 0 to 5 of a 2D surface whose CB_COLOR_ATTRIB3 declares one slice was refused. The CB clamps the render target array index to the view's SLICE_MAX, not to the surface's slice count, so each layer is written one slice pitch further on. PPSA01317 renders a 512x512 cube map this way. Such a view now renders as a 2D array of the view's last slice + 1 slices. AI-assisted: yes
…the volume layer guard The resident image of a 2D array color view only compared the view's own slice offset with the image's layer pitch, which is trivially equal for slice 0. Every slice of the array image is now checked against the slice size DecodeColorBuffer offsets the view by. AttachmentView again requires layer 0 for a 3D target, as it did before layered 2D array views. AI-assisted: yes
A vertex shader exporting the render target index draws one value per layer into a CB_COLOR_VIEW of slices 1 to 3 of a four-slice 2D array and into slices 0 to 2 of a surface of one slice. After the write-back every slice of guest memory must hold its layer's value, and the slices outside the view (slice 0, and slice 3 of the one-slice surface) their initial bytes. AI-assisted: yes
A view that selects slice N of a single-mip 2D color target moved the color address by N slices but kept the CMASK register's address, and a CMASK fast clear of such a slice threw. The CMASK of slice N now sits N whole-slice CMASKs after the register. 3D targets, targets with an array depth and slices of mipmapped targets still throw. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AMD Addrlib's HwlComputeCmaskAddrFromCoord passes the slice into the swizzle pattern as its Z coordinate as well as stepping by sliceSize. The pipe-aligned 16-pipe pattern puts Z0..Z3 into nibble bits 12, 11, 10 and 9, so a slice moves its tiles inside its own block. A uniform CMASK reads the same at every slice, but a mixed one was read at the slice 0 nibbles. CmaskLayout::Nibble takes the slice, ColorTarget carries it as cmaskSlice, and the CMASK clear shader gets it as a push constant, so the CPU and GPU paths agree. The tests pin nibbles evaluated from the Mesa mesa-25.2.0 pattern text and clear partial CMASKs of slices 1, 2, 3 and 8 on the device. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clear every layer of an array or layered color target through its own CMASK slice, offsetting the color address, the CMASK address and the pipe-bank XOR per slice, and widen the written ranges to cover all layers. The per-slice CMASK stride follows Addrlib's slice size; it has not been measured on hardware. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thank you for your contribution! Authors with no pull requests merged into |
Collaborator
|
This was closed by the open-PR limit while our intake was paused, not on its merits. GitHub won't reopen it because the branch changed after the close, so we'll carry it in a new PR that credits you, and review it under the normal process. |
12 tasks done
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
Fast clears the CMASK of array and layered color targets instead of throwing
CMASK fast clears of a 3D or array color target are unsupported. Each layer is cleared through its own CMASK slice: the color address, the CMASK address and the pipe-bank XOR are offset per slice, the CMASK range check covers every layer, and the written-buffer ranges cover all layers. A 3D color target and a slice or array of a mipmapped target still throw, as recorded in the technical debt entry. The per-slice CMASK stride follows Addrlib's slice size and has not been measured on hardware.Stacked on #7254 (layered draws into 2D array color views) and #7668 (CMASK offset of a color target slice); their commits are in this branch until they merge.
Tested
Windows 11, MinGW Release build based on
mainc0adf025b, withANYPS5_REQUIRE_VULKAN=1:ctest -R '^(agc_driver_graphics|agc_driver_cmask_fast_clear)$' --output-on-failure: passed (2/2)ctest -R layered_array_color_draw --output-on-failure: passedpython3 tools/check_conventions.py --base origin/main: 0 errors (the existing debt-length warnings)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)