Repository navigation
Conversation
Titles fast-clear a depth surface by filling its HTILE with ZMASK 0 (DMA_DATA immediate fills or the buffer-fill kernel) instead of drawing. Depth surfaces were only cleared when they were made, so every later frame kept the previous frame's depth and stencil and most draws failed the depth test. The depth target now records DB_HTILE_DATA_BASE. A uniform fill whose ZMASK is 0 and which covers a surface's HTILE marks the surface cleared; its next use as a target or a texture clears it to DB_DEPTH_CLEAR and DB_STENCIL_CLEAR. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ds; HTILE only with TILE_SURFACE_ENABLE A fill over a depth surface's whole HTILE fast-clears the depth when ZMask is 0 and, when the HTILE holds the stencil state (TILE_STENCIL_DISABLE clear), the stencil when SMem is 0; a fill writing an aspect's fields otherwise cancels its pending clear. DB_HTILE_DATA_BASE is taken only with DB_Z_INFO.TILE_SURFACE_ENABLE. Tests cover the decode and HtileFillClears/HtileFillCovers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…erage and clear value as inferred Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A whole-HTILE fill of ZMask 0 clears the depth to DB_DEPTH_CLEAR at the next draw; a fill shorter than the HTILE and an expanded fill (ZMask 0xf) clear nothing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…el DCBs; a CPU-stored fill clears too agc_driver_depth_fast_clear_submit submits the fills the title uses (a DMA_DATA immediate fill and the fill kernel's dispatch) over the HTILE and checks the next depth-tested draw; a depth-only fill over an HTILE with stencil keeps the stencil (a stencil-tested draw). The depth metadata note now also follows the CPU fallback of a fill the device could not store. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Draws with PA_SC_AA_CONFIG multisampling (2, 4 or 8 samples, every target with as many fragments, the standard sample locations, MSAA_ENABLE) render into host-only multisampled color images and multisampled depth surfaces; the pipeline rasterizes with that sample count. A CB_COLOR_CONTROL resolve over a multisampled CB0 runs as a render pass whose resolve attachment is CB1's resident image. A zero fill over a target's CMASK fast-clears it to the CB_COLOR_CLEAR_WORD values of its next use. EQAA, coverage conversion, nonstandard sample locations, sampling a multisampled surface and multisampled mips stay refused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tate refuses what it cannot model The duplicate ColorTarget::cmaskAddress, decode and size helper are gone: multisampled targets use main's cmaskAddress/cmaskBytes (whole metablocks). Single-sample targets keep main's rule (CMASK under FAST_CLEAR); a multisampled one takes it under FAST_CLEAR or COMPRESSION. A zero fill of the whole CMASK clears at the next use, 0xFFFFFFFF marks it expanded, any other or partial fill refuses the next use; eliminate/DCC passes over a multisampled target and a CB resolve into a fast-clear destination are refused. The draw key adds CMASK_BASE_EXT (0x398), which main decodes but did not key. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
decodeSamples refused any PA_SC_AA_SAMPLE_LOCS pattern other than the standard one for the sample count, so a title that rasterizes with an ordered grid threw "nonstandard sample locations are unsupported". The registers give each sample's position as a signed 4-bit offset in 1/16 pixel from the pixel center, which is VK_EXT_sample_locations' 1/16-pixel grid shifted by half a pixel; the console's standard 4x pattern maps exactly onto Vulkan's standard 4x positions. A pattern that is the same for all four pixels of the quad becomes the pipeline's sample locations (a 1x1 grid, part of the pipeline key) on a device with variable sample locations at 1/16 pixel for that sample count; patterns that differ between the pixels still throw. Multisampled depth images are created with SAMPLE_LOCATIONS_COMPATIBLE_DEPTH when the device supports it for their format and sample count, and a draw with custom locations and a depth target the device cannot make compatible throws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
Contributor
Author
|
Closing in favour of #2169, which implements the same thing and was opened first. I've left my Hades II results and a depth-format note there. |
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
Follow-up to #419, as discussed there.
decodeSamplesrefused anyPA_SC_AA_SAMPLE_LOCSpattern other than the standard one for the sample count, so a title that rasterizes with its own pattern threw "nonstandard sample locations are unsupported".The registers give each sample's position as a signed 4-bit offset in 1/16 pixel from the pixel center. VK_EXT_sample_locations takes positions in [0, 1) of the pixel, so a register offset
xis0.5 + x / 16. The console's standard 4x pattern maps exactly onto Vulkan's standard 4x positions this way, which checks both the scale and the direction of y.variableSampleLocations, 4 sub-pixel bits and a coordinate range covering 0 to 15/16, for the draw's sample count. Otherwise a draw with custom locations throws. Requiring variable locations means pipelines with different patterns can share a render pass.SAMPLE_LOCATIONS_COMPATIBLE_DEPTHwhen the device supports that for its format and sample count (vkGetPhysicalDeviceImageFormatPropertieswith the flag and the image's usage). A draw with custom locations whose depth target the device cannot make compatible throws. The depth image stays inGENERALafter creation, so no layout transition needs the locations.PPSA36082
Hades II rasterizes its 4x targets with an ordered grid: the
PA_SC_AA_SAMPLE_LOCSwords are0x444cc4ccfor all four pixels, that is (±4, ±4)/16. On main f145139 with the fixes it needs to get that far plus #419, it threw the error above while rendering (it showed up as a failed presentation). With this change, #2121 and #2132, the game renders those passes correctly in gameplay. On the RTX 4090 every depth format it supports is compatible at 1x to 8x, and the game ran into gameplay with this change with no refusals or skipped draws in the log.Tested
Linux (CachyOS), x86-64, GCC, 7800X3D / RTX 4090.
agc_driver_graphics(new checks):build.ymlrun locally (SPIRV tools on, test registration check, build, libs, ctest), both on this head (468/468) and on it merged with main d70b899 (517/518). feat(agc): multisampled color and depth targets with CB resolves #419 conflicts with main on one line ofTexture.hppsince perf(agc): size the storage and sampled texture caches to the device #1059 (both add a declaration there); for that merge I kept both.agc_driver_dcc_keys_first_writefails on main without this change too.Checklist
NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)