feat(agc): render into mipmapped 3D color targets #7310
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7310"
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 Amoenus on 2026-10-17T22:41:26Z.
What
Render into one mip of an uncompressed3D color surface, preserving the base dimensions and volume identity, including depth1. Use its3D mip layout, bound its slice view by the selected mip's depth, validate the full allocation, and create the resident attachment view at that mip. Unverified mipmapped3D DCC/CMASK metadata paths still throw.
Depends on: none. #7294 is merged. Earlier refreshed head 9a3ae675277b incorporates frozen main
6e9b9134f6ed14e659d870a33118d164096551dfthrough a normal merge; publishedd82f817df54416cc8ad9792382f6018bb57b32a1remains an ancestor and is archived. The eight production/test topic files retain exactly their previous added/removed lines. The #9050 buffer-range helper uses the volume's full backing-allocation address, including cached/moved binding checks; its two focused regressions are retained. No force push.Sonic Unleashed Recompiled PPSA99902, #7260 / #4443, requests a two-level128x128x8 RGBA8_UINT
SW_4KB_S_Xtarget after the opening movie. The ordinary bring-up composition stops at the guard still present on main:The diagnostic captured
CB_COLOR_INFO=0x00070428,ATTRIB2=0x101fc07f,ATTRIB3=0x0ea54007,VIEW=0x0000e000(mip0, slices0..7). #7274 merged the diagnostic; this capability change replaces the general refusal. Its64x4x4/mip1 descriptor test verifies the selected32x2 one-slice view. No title-specific branch or game modification is added.Review correction: non-mipmapped depth-one volumes now bypass the2D resident-byte comparison as all other volumes do; their complete3D allocation was already validated against
DescribeSurface. A single-level linear volume of depth1 retains the existing linear copy path, whose2D/3D layout is identical. Other nonresident volume cases continue to throw. Four new--mipscases cover96x32x1/one level in Linear, Standard4KB, RenderTarget and S4KBX modes, with exact per-texel readback.Overlap review: #7199 and #7254 are merged; their 2D CMASK accounting/refusals and layered-array attachment/dirty-range handling are retained. #7256 array attachment windows remain separate. #6959 implements mesh layer windows. The author confirms #7310-first landing order; its shared fixture must retain both optional Run arguments and enough vertices for the 33-layer mesh case and eight-layer mip cases. JJenkx's attributed Linux composition results below cover that fixture union at their stated pins; our own Windows matrix does not qualify #6959.
Tested
Current refreshed head
2c1f59472aeb, tested maind2d2a866d9a9ed65e9d3871f83dcf427195aa362. Normal merge after#12862 preserves published history/authorship,identical production/regression topic deltas,and all selected test-registration properties. No force push.Exact pins,immutable raw logs,artifact inventories,controls and analysis: 36 positives(30 verified GPU/six CPU or header). Main14GPU/twoCPU;candidate16GPU/threeCPU plus public_headers. Shared layered draw/submit/vertex/no-GPL,XOR volume,depth bounds and new heap-mirror controls run on both GPUs. Candidate additionally passes all14volume-mip selections/vendor(28total) and CPU linear-nonresident refusal. Graphics/ShaderMemory pass on both sources,including intervening descriptor force-sync changes. Full native/relinker/real-fixture builds,conventions/whitespace/public_headers pass;binary inventories stable per source.
Required Vulkan,app cache/journal off,inserted Khronos1.4.363 and actual device identity verified;verbose serial30s. Windows11Enterprise26200/WinLibsGCC15.2,RTX5080/NVIDIA621.01 and RadeonGraphics1002:13c0/AMD26.10.1. Zero validation errors/VUIDs/skips/timeouts;known layer-compatibility warnings main80/candidate100,identical IDs/counts for shared groups. Two extra volume cases account for20warnings. Max wholeGPUprocess1.231s;max anyCTest17.794s. Not warning-free or a performance comparison.
Cppcheck/clang-tidy:115.463 analyzer-seconds,18advisories at unchanged main locations,no parser/configuration failures/timeouts or automatic fixes;no static-clean/whole-program claim. Historical isolated address/metadata mutation controls and previous fixture analysis retain their original pins;no new current-main failing control claimed. Candidate-only registrations are absent on literal main,not passing main controls. Latest inspected6190 has unrelated exports/relinker changes and is not the tested base.
Independent NVIDIA Linux retest of olderd917/main73f4:2430selected passes,no new failures/validation IDs,50skips;BDA/maps/graphics timing warnings remain source-pinned and unresolved by this focused Windows qualification. Prior hosted d917 compile/link evidence is historical;new-head hosted checks pending. No new title/FPS/full-suite/Linux/macOS/console or dependent-stack execution claim.
Additional Linux composition evidence: JJenkx tested this exact head with #6959 head327addf79eae on RX6650XT/RADV Mesa26.2.4. The report has six passing checks, zero skips/VUIDs and four confirmed Khronos layer insertions, covering all14 volume-mip selections plus the33-layer mesh case. Its private base also contains capture/diagnostic changes; this is candidate-only composed evidence, not a paired plain-main qualification or title/FPS result. The shared fixture retains both optional Run arguments and enough vertices for both mip and mesh cases. The agreed #7310-first order remains; our source is unchanged.
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)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T23:09:35Z.
Thanks, the mip addressing and the per-texel
--mipscheck look right, and all ten cases pass here (RTX 4090, current main55f82fee8). One regression on non-mipmapped volumes:The PR now decides "3D target" by
color.volumeinSurfaceForTarget(State.cpp:1453) and in the fallback refusal (Draw.cpp:2079). The resident check at Draw.cpp:2067 still skips the byte comparison only forcolor.mipCount > 1 || color.depth > 1, and it compares against the 2DColorTargetLayout. So a non-mipmapped 3D target of depth 1 in a thick 3D mode now gets a 3D resident image whose bytes differ from the 2D layout. The lookup is refused, and the fallback then throws. On main the same target rendered (as 2D).Repro: replace the
--mipscase list with one case at a time:A linear depth-1 volume without an existing host import reaches the same refusal. It used to render, and linear 3D at depth 1 has the same layout as 2D.
Could you:
DescribeSurfaceinDecodeColorBuffer);levels = 1, depth = 1cases to--mips? The two existing depth-1 cases have three levels, somipCount > 1bypasses the changed check.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T01:23:20Z.
@oneandonlydean 2026-10-20 CI follow-up: I traced the failed Linux job to exact #7310 head
028ec46d836ca0f0a4a31ad00e07f517d82f7955merged into main43cd8f4c47f4c81185c4ca14b84240e0748e3459. It stops at Install Xvfb:sudo: a password is required. CMake, compilation and tests are skipped, so this run does not identify a volume-rendering regression.The Windows job succeeds: 457 executed tests pass and 645 skip.
agc_driver_volume_mip_targetsis among those skips under CI's execution-source selection; this is not new physical-GPU coverage. The actual fourteen-case NVIDIA/AMD checks remain in the description at their stated pins.Main has since reverted the Xvfb workflow setup. Could you start a fresh Build workflow from current main for #7310, rather than rerunning the old job with its old workflow? The PR currently merges cleanly and its attached Conventions check passes. No patch code change is indicated by this setup failure.
AI-assisted: yes (Codex); author responsible.
Earlier depth-one review response and validation
Thanks for catching the depth-one regression. Addressed in a96dad4ef, after rebasing onto mainf663 and removing the now-merged #7294 dependency.
All three requested changes are covered: volumes bypass the2D byte comparison; single-level depth-one linear volumes keep their valid existing copy path;
--mipsnow includes Linear, Standard4KB, RenderTarget and S4KBX one-level/depth-one cases. The new test fails3/3 before correction; the linear-only correction exposes the separate thick-layout failure. Both corrections pass the fourteen-case readback3/3 on RTX5080, AMD iGPU and llvmpipe. Full Windows/Linux builds and33 selected processes pass. Existing3D barrier advisories and analyzer findings are disclosed in the updated body; no warning-clean or title-unblock claim.AI-assisted: Codex; author responsible.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T23:24:07Z.
Apple GPU / MoltenVK run of the new
--mipscases, as another vendor next to RTX 5080, AMD iGPU and llvmpipe. Under MoltenVK, a 3D mip attachment view becomes a Metal render target on one level of a 3D texture, so this path differs from the desktop drivers.Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head bf984211f. Method: main
81cb86339+ @mugurc'sci/macos-series-2(fa6d8ae0b, which has the MoltenVK device bring-up) + the open fixes it uses as stand-ins, then this PR merged on top (clean). Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363), and MoltenVK main with SPIRV-Cross #2704.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1.agc_driver_volume_mip_targets(new)agc_driver_layered_volume_submitagc_driver_layered_volume_draw,_vertex,_vertex_no_gpl--mipsruns all 14 cases here, each "preserves other mips and slices": 96x32x8 at mips 0/1/2, the 96x32x1 depth-one volume, and the 128x128x8 RGBA8_UINT two-level target from the title, including the XOR=500 case.The three layered tests fail the same way with and without the PR:
SPIR-V requires unsupported device capability 2. That's the Geometry capability, which MoltenVK doesn't have. It's a device gap this PR doesn't touch.With only the test and CMake changes on the tree without the fix,
agc_driver_volume_mip_targetsfails:a depth-one volume mip was treated as a 2D image. So the new test catches the missing support on this device too.Not done: the full suite with the PR.
GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T13:24:29Z.
Review: COMMENTED
Reviewed head
b49ce040799don main4017310678562c(both the head as-is and a local merge onto main, which is clean). Linux, GCC 13 Release, lavapipe (llvmpipe, Mesa 25.2.8). No AMD/NVIDIA here, so nothing on the GPL-off question.What I ran, each
--repeat until-fail:3withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:agc_driver_volume_mip_targets,linear_volume_nonresident,layered_volume_{draw,submit,vertex,vertex_no_gpl},image_xor_swizzle_volume,graphics.--mipsrun prints all 14 cases.volume_mip_targetsfails with "a depth-one volume mip was treated as a 2D image".graphicsandlinear_volume_nonresidentfail on main's "mipmapped 3D color targets are unsupported". The 5 shared tests pass on both sides.VUID-VkDeviceCreateInfo-pNext-pNextat device creation, which comes from my older layer.One problem: for a mip that isn't at offset 0, the color target's byte window runs past the end of the volume.
DecodeColorBuffernow setscolor.bytesto the whole surface (State.cpp:2113), butcolor.addressis stillsurfaceAddress + mipOffset(State.cpp:2032). Everything that uses the two together sees[surface + mipOffset, surface + mipOffset + guestBytes). That's the end of the volume plusmipOffsetextra bytes. The buffer alias checks (CheckBufferAliasesDraw.cpp:1043, ShaderResources.cpp:4381) and the index/vertex alias checks (Draw.cpp:1344, 1561) all read that window.Example: I changed the
--mipsfixture to put the vertex buffer right after the volume allocation. Two cases then throwshader buffer aliases the render target:The other 12 cases still pass. As a probe, I ended the window at the surface end (
bytes = guestBytes - mipOffset), and then all 14 pass. So a title that allocates a buffer right after a mipmapped volume would fail its draw.A fix could check
[surfaceAddress, surfaceAddress + guestBytes)at those sites, or keepcolor.bytesper view and carry the surface size separately. A--mipscase with a buffer right after the volume would pin it.