Repository navigation
feat(agc): rasterize sample locations that vary between pixels through a 2x2 grid - #5861
Conversation
…h a 2x2 grid PA_SC_AA_SAMPLE_LOCS_PIXEL_* patterns that differ between the four pixels of the guest's 2x2 grid threw. Pass them through VK_EXT_sample_locations as a 2x2 sample location grid on devices whose maxSampleLocationGridSize for the sample count allows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checked the decode against the register order and the Vulkan grid indexing ( |
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
|
For the record, on an RTX 3070 Laptop GPU this check stops Resident Evil Village (PPSA01556, 01.210.000) during its title screen: Windows 11 (10.0.26300), driver 617.42, Village needs local changes to reach the title on this 16 GB PC: #5851, #5703, #5815's two commits, and local commits that prepare shaders at their first draw and fix title-stage stops. The run also carried an unrelated overlay branch. Locally we approximate by using pixel (0,0)'s locations for every pixel, a workaround that isn't for merging. |
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
…a pipeline boykopovar#5861 added both to the pipeline state and its store key; the recipe dropped them, so a replayed pipeline keyed another configuration. Co-Authored-By: Claude <noreply@anthropic.com>
What
Onimusha: Way of the Sword (PPSA27836) and Resident Evil Village (PPSA01556, #5169) render with two-sample checkerboard rendering. Their
PA_SC_AA_SAMPLE_LOCS_PIXEL_*registers differ between the pixels of the guest's 2x2 grid:That is samples at (+4, 0)/16 and (-4, 0)/16 on even rows, swapped on odd rows.
decodeSampleLocationsthrew "nonstandard sample locations varying between pixels are unsupported".VK_EXT_sample_locations takes such a pattern as a sample location grid.
VkSampleLocationsInfoEXTindexes it as(x + y * width) * samplesPerPixel + i, which is the guest's register order (X0Y0, X1Y0, X0Y1, X1Y1). The draw state rule refuses a nonzero window offset, so the host framebuffer origin is the guest's and the grid lines up.Statekeeps the locations of all four pixels (sampleLocationsgrows to 32 bytes, pixel * 8 + sample) and setssampleLocationGridwhen they differ.SampleLocationGridgives 2x2 or 1x1, andSampleLocationsfills the grid in Vulkan's order.VkMultisamplePropertiesEXT::maxSampleLocationGridSizeis a multiple of 2x2 (sampleLocationGridSampleCounts). A pattern varying between pixels on any other sample count throws, naming the grid.docs/dev/debt/libSceAgcDriver.mdare updated.The per-sample-count query matters:
VkPhysicalDeviceSampleLocationsPropertiesEXT::maxSampleLocationGridSizeon the RTX 5070 is 1x1, butvkGetPhysicalDeviceMultisamplePropertiesEXTgives 2x4 for 2 samples, 2x2 for 4 and 1x2 for 8. The AMD iGPU gives 2x2 for each. So both GPUs here take the checkerboard pattern.Tested
main5a6ad0e:ctest -j 8on the RTX 5070: 1183 of 1184 pass;check_main_syncfails on a Windows code page and is unrelated;ctest -R "agc|shader|video_out"on the AMD iGPU: 551 of 554 pass;agc_driver_lds_mixed_width_atomics,agc_driver_pixel_interlockandagc_driver_layered_volume_vertex_no_gplfail as listed in agc_* tests: 3 of 483 fail on AMD Radeon RX 6400, pass on NVIDIA RTX 4080 SUPER #5271 for this GPU.agc_driver_graphics: the old refusal case (a standard 2x pattern with the samples swapped in one pixel) now decodes as a grid. The games' pattern decodes as a 2x2 grid with the locations in Vulkan's order.ValidateSampleLocationsrefuses it without grid support for 2 samples and accepts it with it. A uniform 4x pattern stays 1x1.agc_pipeline_library(on the GPU): a grid pattern builds its own fragment shader and fragment output libraries, and the uniform pattern is reused afterwards. It passes on both GPUs.python tools/check_conventions.py --base upstream/main: passes.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 — not applicable.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code