feat(agc): pass custom sample locations through VK_EXT_sample_locations #2183
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2183"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T10:59:42Z.
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 mainf1451396with 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 maind70b8998(517/518). #419 conflicts with main on one line ofTexture.hppsince #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)Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T11:07:49Z.
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.
Pull request closed