Repository navigation
feat(agc): sample a multisampled color target through its 2D MSAA texture - #4820
Conversation
|
Tested with ProsperoPuzzles (PPSA99006, catalog release,
So the shader's static interface for this binding is now the 2D MSAA shape (dim 6) in every mode, while the T# the title binds at that draw decodes as dim 3. Whether that T# is a plain 2D view of the MSAA target or a different resource I haven't traced; the full T# is above in case it helps. Happy to rerun on a new head. Tested with Claude Code assistance. |
|
@nicolasfalesy thanks for the runs, that is a result I did not have: nothing here was tested on Linux or on Intel. That stop is a separate one from what this PR changes. The T# in your log ( What the hardware returns when a If you rerun, the later AI-assisted: yes (Claude Code). |
|
Windows 11 run (RTX 3080, NVIDIA 591.86, WinLibs GCC 15.2, Release): head e7cf856 merged onto
|
|
Ran this on AMD hardware, since the GPU tests in CI run only on lavapipe: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Head
AI-assisted: yes (Claude Code) |
|
@babyhuey @LeandroLP23 thank you both, and @nicolasfalesy again. The AMD run is the first one on that vendor, and I added all three reports to the description. A request for @babyhuey and @nicolasfalesy, if you have the time: could you rerun with #4935 merged as well? The reason is a hypothesis, not something I have verified on your setups. After this PR the title stops in a different place on each machine: @LeandroLP23, the 13 FPS matches what I measured before #4935 (33 to 48 ms per frame on an RTX 4070); with it the title holds 16.7 ms here. An AMD number with #4935 would be useful, but only if it is convenient. AI-assisted: yes (Claude Code). |
|
Checked the diff, built it merged onto current |
|
@nicolasabosch Thanks. I can't run it right now. If someone else with an AMD GPU can, please go ahead; otherwise I'll post the AMD number with #4935 merged as well later today or tomorrow. |
|
@nicolasabosch AMD numbers, same machine as before: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Both builds are on
With #4935 the frame time roughly halves here, but it stays near 40 ms rather than 16.7 ms. On this machine #4820 alone did not stop in any run: the AI-assisted: yes (Claude Code) |
|
@Amoenus thank you for the fixture and the correction. It is applied in I reproduced it here before applying it, with Noted on #5445: once it lands, the lookup after a remap may import uniform memory instead of refusing, so that assertion of the test changes there and the new-contents one stays. AI-assisted: yes (Claude Code). |
|
Windows 11 Pro, Intel Core i9-14900K, 128 GB, NVIDIA GeForce RTX 5080 (driver 32.0.16.1714), WinLibs GCC 15.2.0, Release, Tests
ProsperoPuzzles, 60 s runs
Screenshots on the head (the base exits before the first screenshot at 15 s): Verdict: works on Windows with an RTX 5080. The stop is gone, and the title runs and plays without #4935 on this base. |
…ture A shader that loads from a 2D multisampled image whose T# names a color target rendered on the host is bound to a view of that target's image. Other multisampled textures keep throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mpled target A uniform fill of a multisampled target's color memory is held until the next draw. A shader that samples the target first now sees the fill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto main: kept your multisample sampling next to the recent MSAA fill and alpha-to-coverage changes; build and agc tests pass. |
4e6a15e to
84f6364
Compare
|
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.
|
|
Independent Linux/RTX 5070 title validation after this PR merged. I compared the exact merge Ubuntu 26.04.1 x86-64, GCC 15.2.0, bundled Release build with testing/SPIR-V Tools enabled; NVIDIA GeForce RTX 5070, driver 595.99.02. Title: ProsperoPuzzles, PPSA99006, content version 01.000.010, developer release. Package SHA-256:
This verifies Linux title progress and the sampled MSAA regressions at the recorded merge, not all 50 puzzles or later main. SDL dummy audio was used; audible output was not tested. Project shader cache was disabled, NVIDIA driver caching stayed at defaults, and no performance comparison or native PS5 measurement is claimed. AI-assisted testing/report: Codex. The implementation and its original author are unchanged. |



What
A shader that loads from a 2D multisampled image no longer stops at
DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shapewhen the image is a color target that draws rendered on the host. Part of #3036.DescriptorBindingBuildergives a 2D multisampled image the new shapeDescriptorImageShape::Image2DMultisample. Multisampled arrays still throw.DecodeTextureResourcedecodes T# type 14 asTextureDimension::k2DMsaa. The sample count is1 << LAST_LEVEL, withBASE_LEVEL0 andMAX_MIPequal toLAST_LEVEL, asac_build_gfx10_texture_descriptorwrites them (Mesasrc/amd/common/ac_descriptors.c,1e2c42b6). A descriptor that differs throws. The surface decodes with one mip level.MultisampleTargetTexture), when the target has the same format, size and sample count. The target's image getsVK_IMAGE_USAGE_SAMPLED_BITwhen the device can sample its format at that sample count. Nothing is read from or written to guest memory.No instruction semantics change: the SPIR-V for
image_loadon a2d_msaaimage (OpImageFetchwith the sample operand) is already onmain.Open pull requests that
tools/pr_overlap.pyhas listed against this one asmainmoved, none of which implements this: #4767 (FMASK decompress on multisampled targets) changesMultisampleTargetand applies pending CMASK fast clears to the host image, the state this change refuses to sample, so whichever merges second adjusts that check; #4790 (FMASK images from a metadata snapshot) changes the same lookup inShaderResources.cpp; #4451 adds an adjacent line inCMakeLists.txt.Not covered, still throwing as before: FMASK, compressed samples, EQAA, multisampled depth, multisampled arrays, and multisampled textures that are not host-rendered targets.
Tested
Windows 11, NVIDIA RTX 4070 Laptop GPU, WinLibs GCC 15.2.0 r7, Release,
ANYPS5_ENABLE_SPIRV_TOOLS=ON, ate7cf856f0, which hasmaine51428bf2merged in.agc_driver_sample_multisample_target: draws a triangle into a 16x16 RGBA16F 4x target, then a compute shader loads every sample through the T# withimage_loadon2d_msaa. All 1017 samples farther than 1/32 pixel from an edge match the triangle's coverage atSampleLocations(state); the other 7 are only checked to hold the drawn or the cleared color. 14 pixels are partly covered. With the expected sample order rotated by one the test fails. It then fills the target's color memory with half-float ones and every sample loads as (1, 1, 1, 1); without the fill being applied at the lookup that check fails. It also checks the refusals for a T# of 8 samples over the 4x target and for a T# no draw rendered to.agc_multisample_guest_access(extended): the 4x target binds as a sampled texture in its layout, a second lookup returns the same texture, and the refusals for another sample count, another width, no target and storage access.agc_driver_graphics(extended): type 14 decoding, including the T# PPSA99006 passes (021f2000 03800000 804a004a e1b20fac 00000000 00400020 00000000 00000000), and its rejections.ctest -j 8: 1029 passed, 8 skipped, 0 failed, out of 1037.4e6a15edd(merged withmain30f961266): the sampled lookup skips targets retired when their allocation was unmapped, as attachment acquisition already does since fix(agc): retire fully unmapped multisample targets #4474. Reported with a fixture and the one-line correction by Amoenus in feat(agc): sample a multisampled color target through its 2D MSAA texture #4820 (comment).agc_multisample_guest_accessnow samples after each remap: without the line it fails (sampling a multisampled target whose allocation was unmapped did not throw), with it it passes 5 of 5, and a target acquired at the same address is sampled through a new texture. Fullctest -j 8there: 1103 passed, 8 skipped, 0 failed, out of 1111. The title was not rerun at this commit.--windows --to-intel), ate7cf856f0withmaine51428bf2: one 46 s run does not stop. The title's log reports 600 frames (mean 19.98 ms, max 25.07 ms) and 902 present calls with 0 failures. Before fix(agc): size multisample guest guards by fragment blocks #4199 was merged the title stopped at the guard range (a CPU read of 0x21f400000+0x90000 overlaps multisampled color target 0x21f200000+0x240000) after the two lookups of its first 4x canvas.main7e181fcc3: 3 of 3 runs stop before present 300 withbuffer descriptor uses an unsupported type. With perf(agc): present and keep pending only the drawn slice of an array color target #4935 merged as well, 3 of 3 runs of 26 s do not stop, and a frame dumped withAPS5_DUMP_FRAMESshows the title's menu with its game thumbnails. Why this branch alone stops there was not investigated.download0, it stops at this change's own refusal,sampling the 91x145 multisampled texture 0x220c00000 of 4 samples, which no draw rendered to, is not implemented: the title clears that canvas (clear-msaa4-colorin its log) and samples it without drawing into it.main37dd48308: the descriptor shape stop is gone and 3 of 3 runs then stop atimage descriptor is incompatible with the static runtime image interface, where the title's resolve shader (image_loadon2d_msaa) is given a T# of type 2D. That stop did not occur in the Windows runs above; not investigated.main9ba9ac1c8:ctest -R '^agc_'461 of 461, and the title runs 60 s at about 13 FPS.maindacd78525, three 60 s runs per build: this branch alone does not stop in any of them (window FPS 11.67 to 12.49); with perf(agc): present and keep pending only the drawn slice of an array color target #4935 as well, 3 of 3 do not stop (24.42 to 25.86).mainea2bbefb: the descriptor shape stop is gone and the title then stops after 7.7 s atruntime image descriptor is invalid, on a T# whose type field is 0; the tests of this change pass 5 of 5 there.main(an unsupported buffer descriptor type here on7e181fcc3, an invalid image descriptor on the RTX 3080, a 2D T# in the resolve shader on Intel, none on the Radeon 860M ondacd78525). Here the stop goes away with perf(agc): present and keep pending only the drawn slice of an array color target #4935; whether the RTX 3080 and Intel ones do is not known.Not tested here: Linux, AMD and Intel GPUs, lavapipe, sample counts other than 4, and formats other than RGBA16F in the execution test. The Linux and AMD results above are the reporters' own.
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