Repository navigation
Conversation
adriadam10
left a comment
There was a problem hiding this comment.
Thanks, the approach (carry the attachment's numeric type into the request and cache keys) looks right. Points to fix before this can merge:
- Conflicts with
mainin 9 files (State.cpp,ShaderValidation.cpp,SpirvModuleEmitter.cpp,Recompiler.hpp,RequestSerializer.cpp,DrawRegisterKey.cpp,Graphics.cpp,ShaderMemory.cpp,RequestSerializerTests.cpp).mainis already at request serialization version 32 (this PR bumps 29 to 30), so the version, the base64 prefixes and the byte-level fixtures inRequestSerializerTests.cpp/ShaderMemory.cppneed redoing on top of 32, with older versions still replaying. ColorOutputTypeOf(State.cpp:1081) is incomplete.mainalready decodesVK_FORMAT_R8G8_UINT(State.cpp:800) but it is missing from the Uint cases, so an 8_8 UINT target falls back to Float (also reported by @Amoenus on911920f04, with a proposed fix). OnlyR32_SINTis Sint: every other SINT format the decoder can produce would silently get a float interface. Please derive the type from the format family (or list every UINT/SINT format the decoder returns) and add a test row per format.
Welcome to push the rebased version.
|
A title that hits this: Art Swap PPSA99318 v1.2.0 writes a float fragment output into an
AI-assisted: yes |
|
Another title on Apple M2 (macOS 26, MoltenVK, Rosetta) that stops on this: PS5CEMU-HAR PPSA99360 5.0.0, converted with |
|
@firesand I rebased your The rebase resolves the newer draw-key, blending, sample-state and serializer changes. It preserves reversed-component blending, packed float targets and targetless-output validation, includes the newer Main keeps request format 42 for automatic output types and uses a provisional format 43 for explicit numeric types. That number needs coordination with #9356, which also uses 43, before any merge. The shader-cache payload layout is unchanged; the new output type participates in its request identity and changed sources invalidate old artifacts. The actual generated On Apple M4 / MoltenVK / x86_64 under Rosetta:
#7746 is a merged test-only correction related to #7703, not a replacement for this production fix. I have not tested the rebase on Windows or Linux. Happy to provide the branch for your review rather than open a competing PR. AI-assisted: yes |
adriadam10
left a comment
There was a problem hiding this comment.
Still blocked on a rebase, and it is no longer mechanical. Checked against current main:
- Conflicts in 12 files (29 hunks), not only the serializer:
State.cpp,State.hpp,ShaderValidation.cpp,Recompiler.hpp,CacheKey.hpp,DrawRegisterKey.cpp,SpirvModuleEmitter.cpp,RequestSerializer.cppand four test files.mainis at request serialization version 46 (this PR bumps 29 to 30), so the version, the base64 prefixes and the byte-level fixtures need redoing on top of 46, with older versions still replaying. mainnow has its own integer-export mechanism:ColorTarget::uintExport(State.hpp:67, set fromslotExport == 7inState.cpp:1492, added in 4554135) and the matchingvertex:u32x4check inShaderValidation.cpp:728-730. This PR'sColorOutputTypeoverlaps it. Please fold one into the other (for example deriveuintExportfrom the new per-attachment type, or drop it) so there is one place that decides the interface, keeping the "blending into an unsigned integer target is unsupported" check and the UINT16_ABGR tests working.ColorOutputTypeOf(State.cpp:1081) is incomplete (unchanged from our earlier comment):VK_FORMAT_R8G8_UINTfalls back to Float, and onlyR32_SINTis Sint. Derive the type from the format family, or list every UINT/SINT format the decoder returns, and add a test row per format.
Alexius0815 posted a rebase of this commit (https://github.com/Alexius0815/AnyPS5/tree/contrib/integer-attachment-exports) that can be a starting point, but it predates the uintExport interaction and the current serializer version. Welcome to push the rebased version.
|
@adriadam10 @firesand @rooklz before updating the broader #6235 rebase, I checked current main ( #9789 covers the raw-UINT attachment mismatch that motivated our M4 work here, using the existing export-packing specialization rather than adding a separate per-attachment output-type field. It also retains the UINT16_ABGR path. Our existing fork rebase ( Two differences need an explicit scope decision:
Would you prefer #9789 to own the raw-UINT fix, with #6235 narrowed to the remaining signed-output/format coverage after it lands? That would avoid two competing interface decisions and an unnecessary second representation for the same UINT output. #9789's current head narrows its claim: only This is a source/review coordination check only: no new runtime measurements or correctness claims, and no updated rebase has been pushed. AI-assisted: yes |
|
@firesand Following up on the mapping-hunk coordination proposal: could we agree on #12280 → #6235, with #6235 carrying the downstream integration and combined export validation? I re-read your current AI-assisted: yes (Codex). |
|
stale+rebase 1. Freshness Envelope
2. Findings
3. Cross-PR Ledger
|
What
Raw32 fragment exports currently get a floating-point SPIR-V interface even when the color attachment is UINT or SINT: the interface is selected from the export encoding alone, with only UINT16 mode 7 treated as integer. Carry the attachment's numeric type into shader preparation so modes 1/2/3/9 preserve unsigned words or bitcast signed words through matching output interfaces. Keep packed UNORM on its existing logical-float/packing path.
Include the numeric type in draw and shader cache identities, and serialize it in request format 30. Older captures keep their previous automatic mode-based behavior. Reject compressed raw32 integer exports; signed16 mode 8, integer blending and integer alpha-to-coverage remain unsupported.
The GPU regression covers raw signed/unsigned bits, defined-channel mappings, separate UINT/SINT MRTs and one registered shader switching float→UINT→SINT→float without reusing an incompatible interface. It also covers compressed-raw32 refusal and existing UINT16 preparation. Existing graphics fixtures now distinguish integer attachments from float and packed UNORM attachments.
Semantics: AMD's SI register reference, SPI_SHADER_COL_FORMAT at 0x28714, permits float or signed/unsigned integer raw32 formats. Pinned Mesa export lowering preserves the 32-bit values and defines the R/RG/GFX10+RA placement; format selection selects the corresponding raw formats. RDNA2 ISA §11.1/Table 56 defines compressed exports as 16-bit components. Missing-component defaults have not been verified on native hardware; tests exclude those channels and the limitation is recorded in docs/dev/debt/shader.md. Vulkan readbacks do not constitute a native console oracle.
Related work: #5200 changes reversed-component-order blending and touches shared state/cache/serializer files. It does not implement this integer-output fix. No dependency on it is introduced; merging either may require rebasing the other. Targeted open-PR searches found no direct duplicate.
Tested
Release build and patched
libstarget passed. The final 1,230-test CTest run completed with 1,217 passed, 12 expected device/display skips, and one allocator failure. All changed shader, cache, serialization and graphics tests passed.guest_allocator_failuresreportsmalloc(300 GiB): succeeded despite RLIMIT_DATA; the same unchanged test fails identically on main on this host. Its cause is outside this patch and remains unresolved. CTest therefore exits 8; this is not an all-green run.d92a8dad390af1807cc91622b924252141816a5a; candidate:911920f04450f7e063235a988fe79681d210e261(one commit). Remote main was rechecked after validation.runtime export mapping uses the wrong scalar typebefore drawing. The candidate's--raw32-integercase passes with GPU readback. The two-line baseline patch is included below.ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure --timeout 120 -j1; 234.87 seconds. Skip checker accepts all 12 skips: one missingVK_EXT_shader_stencil_exportand 11 offscreen display tests.APS5_NO_GPL=1. Conventions, test registration (883 executables) and whitespace checks pass. Validation excerpts and the baseline reproduction patch are included below; full JUnit and build logs are retained locally.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryValidation excerpts and baseline reproduction
Final candidate
911920f04, GCC 16.2.1, Gentoo Linux, kernel 7.2.9-cachyos-dist, NVIDIA RTX 4090 driver 615.78.08:Independent build from base
d92a8dad3with unchanged production code and only this fixture patch:cmake --build build --target agc_driver_prepared_exports_tests guest_allocator_failures_tests --parallel 6 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure --timeout 120 -j1 -R "^(agc_driver_prepared_exports|guest_allocator_failures)$"Baseline results:
Candidate direct regression:
The candidate fixture supplies the new numeric-type field and checks GPU readback. Main's original API lacks that field; its test-only reproduction checks the resulting SPIR-V scalar mismatch before drawing. No game assets or title-specific patches are required.