Repository navigation
feat(agc): implement 11_11_10 float color targets through 32-bit uint attachments - #7207
Conversation
|
Thanks, this looks good. The layout, swap, 0xc6 handling, RTZ conversion and cache keys all check out, and the test's CPU reference covers the awkward inputs (NaN, ±Inf, -0, negatives, denormals, overflow). Two small asks before merge:
|
|
AMD data point, since the description lists an RTX 5090: head
Not checked: other tests, titles. AI-assisted: yes (Claude Code). |
|
Heads-up on ordering: #7213 (5_6_5 UNORM colour targets) edits the same swap > 1 allow-list line in |
|
Thanks for the review. Both are done in ec28b6b.
I'll rebase onto main once #7213 lands, keeping both formats in the swap allow-list. @TheSovietWaffle thanks for the AMD run. AI-assisted: yes |
|
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.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Second NVIDIA generation + first Intel, head
|
|
Follow-up on the ROUND_MODE question: I booted PPSA01317 on current main with ec28b6b applied and temporarily logged the register. Its format-7 target has CB_COLOR_INFO = 0x0004171c, so bit 18 (ROUND_MODE) is 1, truncation. Neither new refusal fires, and the title renders past this format. AI-assisted: yes |
6786aab to
d0a9943
Compare
|
Rebased onto main after #7213 (force-push; head d0a9943). The only conflict was the swap > 1 allow-list line in AI-assisted: yes |
… attachments Color format 7 (COLOR_11_11_10, float) keeps its 10-bit component in the low bits; with the reversed component order (COMP_SWAP 2) that is blue, with red in the high 11 bits. Vulkan has no such layout, so the target was refused at decode. Render it the way 10_11_11 unorm targets are rendered: an R32_UINT attachment, the reversed export mapping 0xc6, and a new ColorExportPacking::Float11_11_10 that makes the pixel shader pack each export with the format-43 image store conversion (toward zero, overflow to the largest finite value, negatives to zero, NaN kept). Blending, partial writes, 16-bit integer exports, DCC and the other component orders throw. AI-assisted: yes
…ed color targets An 11_11_10 float color target with CB_COLOR_INFO ROUND_MODE (bit 18) clear asks the CB to round, but the export packing truncates toward zero, so such a target now throws. A CB resolve whose source is a packed 10_11_11 unorm or 11_11_10 float target would resolve the raw R32_UINT words, which an integer resolve cannot average, so it now throws at decode. AI-assisted: yes
The blend-refusal case used CB_BLEND_CONTROL 0x60010001, which is ONE * source + ZERO * destination: a replace blend that writes the source unchanged. A packed target can draw such a blend with blending disabled, so the case now uses the additive blend 0x60010101, which a packed target must still refuse. AI-assisted: yes
d0a9943 to
45c78bb
Compare
…t with Mbed TLS sceSslConnect, sceSslRead, sceSslWrite and sceSslClose threw NotImplemented because the library had no transport, so every title that reaches its first TLS connection stopped there; Gran Turismo 7 does so on main with boykopovar#7137, boykopovar#7207 and boykopovar#7175 right after the save-data mount (boykopovar#6350, D4697). The connection now opens a Mbed TLS 3.6.7 client session over the native socket behind the title's libSceNet descriptor, found through the kernel's socket lookup, so the title's own socket carries the TLS stream whether it is blocking or not. The context's loaded CAs are the trust store and its client certificate and key are offered when loaded; the hostname is sent as SNI; the minimum version maps to TLS 1.2 with TLS 1.3 allowed; the sceSslSetAlpn list is split on commas and negotiated, and sceSslGetAlpnSelected returns the result. Verification applies the enabled SERVER_VERIFY, CN_CHECK, NOT_AFTER_CHECK, NOT_BEFORE_CHECK and KNOWN_CA_CHECK options after the handshake and returns the matching SSL_ERROR_* code; a verify callback gets the connection id, that code, handles to a copy of the peer chain usable with the certificate name calls, the chain length and the user argument, and a negative return fails the connect with SSL_ERROR_APPLICATION_VERIFICATION_CALLBACK_CHECK. Non-blocking sockets get SSL_ERROR_WANT_POLLIN and WANT_POLLOUT from connect, read and write; receive timeouts, close notify, resets, fatal alerts and an exhausted memory pool map to their codes, whose values follow KytyPS5's errno.h as the file's other codes already do. All TLS state comes from the context's pool through the existing allocator, connections carry their own I/O lock so one blocking read no longer serialises every other SSL call, and sceSslTerm tears down its connections' transports before the context goes away. sceSslClose takes the connection id, following SharpProspero. guest_ssl_transport runs an in-process Mbed TLS server with a generated P-256 self-signed certificate on a loopback port and drives the client through libSceNet sockets and the public sceSsl calls: the happy path with ALPN and echo, SSL_ERROR_EOF on the server's close notify, unknown CA, CN mismatch, CN check disabled, verification disabled, a verify callback that accepts an untrusted chain and reads the peer's subject through the handles, one that rejects, the non-blocking handshake, read and write loop, and an unknown socket. The debt note describes what is real now and what is still unmeasured on a console.
…t with Mbed TLS sceSslConnect, sceSslRead, sceSslWrite and sceSslClose threw NotImplemented because the library had no transport, so every title that reaches its first TLS connection stopped there; Gran Turismo 7 does so on main with boykopovar#7137, boykopovar#7207 and boykopovar#7175 right after the save-data mount (boykopovar#6350, D4697). The connection now opens a Mbed TLS 3.6.7 client session over the native socket behind the title's libSceNet descriptor, found through the kernel's socket lookup, so the title's own socket carries the TLS stream whether it is blocking or not. The context's loaded CAs are the trust store and its client certificate and key are offered when loaded; the hostname is sent as SNI; the minimum version maps to TLS 1.2 with TLS 1.3 allowed; the sceSslSetAlpn list is split on commas and negotiated, and sceSslGetAlpnSelected returns the result. Verification applies the enabled SERVER_VERIFY, CN_CHECK, NOT_AFTER_CHECK, NOT_BEFORE_CHECK and KNOWN_CA_CHECK options after the handshake and returns the matching SSL_ERROR_* code; a verify callback gets the connection id, that code, handles to a copy of the peer chain usable with the certificate name calls, the chain length and the user argument, and a negative return fails the connect with SSL_ERROR_APPLICATION_VERIFICATION_CALLBACK_CHECK. Non-blocking sockets get SSL_ERROR_WANT_POLLIN and WANT_POLLOUT from connect, read and write; receive timeouts, close notify, resets, fatal alerts and an exhausted memory pool map to their codes, whose values follow KytyPS5's errno.h as the file's other codes already do. All TLS state comes from the context's pool through the existing allocator, connections carry their own I/O lock so one blocking read no longer serialises every other SSL call, and sceSslTerm tears down its connections' transports before the context goes away. sceSslClose takes the connection id, following SharpProspero. guest_ssl_transport runs an in-process Mbed TLS server with a generated P-256 self-signed certificate on a loopback port and drives the client through libSceNet sockets and the public sceSsl calls: the happy path with ALPN and echo, SSL_ERROR_EOF on the server's close notify, unknown CA, CN mismatch, CN check disabled, verification disabled, a verify callback that accepts an untrusted chain and reads the peer's subject through the handles, one that rejects, the non-blocking handshake, read and write loop, and an unknown socket. The debt note describes what is real now and what is still unmeasured on a console.
What
Color format 7 (
COLOR_11_11_10, float) packs its 10-bit component in bits 0-9 and its two 11-bit components in bits 10-20 and 21-31. COMP_SWAP 2 (reversed order) puts blue in the low 10 bits and red in the high 11. Vulkan has no format with that layout (B10G11R11_UFLOATkeeps red in the low 11 bits), so such a target was refused withunsupported color format 7 number type 7 component swap 2.This takes the path that 10_11_11 unorm targets already use (#1485):
DecodeColorFormatmaps format 7, float, swap 2 to anR32_UINTattachment with the reversed export mapping0xc6and the newColorExportPacking::Float11_11_10.Format10_11_11Float(the layout of image format 43) with the float-to-small-float conversion that format-43 image stores already use: toward zero, overflow to the largest finite value, negatives to zero, NaN kept. The registered artifact is shared; only the pipeline specialization differs.Tested
agc_driver_graphics_tests: newfloat11_11_10TargetTestscovers decode (R32_UINT, mapping 0xc6, packing), the refused swaps, number types, blending, partial writes, int16 exports and DCC, and that ROUND_MODE (CB_COLOR_INFO bit 18) = 1 (truncate) is accepted while bit 18 = 0 (round) is refused. It also checks that serialization keeps the packing, that the specialization differs from the unorm one on the same artifact, shader validation, and that an out-of-range packing value is refused.agc_driver_graphics_testsmultisampleTests: a CB resolve whose source is a packed 10_11_11 unorm or 11_11_10 float target is refused at decode.agc_driver_packed_float_color_target_tests(new): draws 32_ABGR and FP16_ABGR exports into tiled and linear format-7 targets. It compares every pixel with an independent reference packing, including truncation, overflow, Inf, NaN, negatives, small-float subnormals and f32 denormals. It also checks that pixels outside the scissor keep their contents.agc_driver_packed_unorm_color_target_tests,agc_shader_memory_testsand the recorder resolve tests (agc_tiled_resolve,agc_multisample_guest_access,agc_metadata_pass) still pass.request_serializer_testsand the dual-source, reversed-order, SWAP_ALT blend, prepared export/publication and 1_5_5_5 target tests still pass.tools/check_conventions.pypasses.r14+0x48) while the title's video-out/flip frame-pacing loop runs #6350) stopped atunsupported color format 7 number type 7 component swap 2at its first presented frame. With this change it renders past that format and stops later on an unrelated unimplemented sample of a converted float image (feat(shader): sample converted unorm images in the shader #5958).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)