main now registers tiled PS4 display buffers, so the PS4 change call
accepts tiling mode 0 as well: it stores the attribute without a pitch
and recomputes the group's PS4 pitch as registration does. The width
against pitch check still applies to tiled attributes, as in shadPS4.
The test changes a group to tiled at two pitches and back to linear
instead of expecting the old refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 13.42 module's sceVideoOutSubmitChangeBufferAttribute (0x112e0)
returns 0x80290002 for a null attribute before it looks up the handle,
then 0x8029000b for an unknown handle, and leaves every other check to
the port's handler. Check the attribute first and return the code
instead of throwing, then the handle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace a legacy PS4 buffer group's attribute through the PS4 call,
following shadPS4 commit 2183807e592b36d4440384878165b43d930c1dee
(video_out.cpp:452-460, driver.cpp:198-240): an aspect ratio other than
0, a width above the pitch and a tiling mode above linear return their
VideoOut errors. The conversion matches legacy registration and the
update matches sceVideoOutSubmitChangeBufferAttribute2, keeping buffer
addresses and pending flips.
Missing groups, reserved fields, null attributes, out-of-range indices
and PS5 groups throw, as the registration and Attribute2 paths do for
the same inputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EVO Player and Prospero Win measured RESOURCE_BUSY on ports opened on
bus type 0. The overlay bus is unmeasured, so its on-screen set is
still released as before, which video_out_flip_overlay relies on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The console answers RESOURCE_BUSY (0x80290009) when the set holding
the buffer on screen is unregistered, and the set stays registered:
EVO Player measured it with a re-registration then failing
SLOT_OCCUPIED, and Prospero Win on firmware 12.02 after its flips went
idle. The set was released and 0 returned instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The console answers sceVideoOutRegisterBuffers2 with SLOT_OCCUPIED
(0x80290010) when the buffer slots are still registered: EVO Player
measured it re-registering set 0 while that set stayed on screen. The
call threw INVALID_INDEX instead. The PS4 call and an occupied set over
free slots keep throwing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PS5_Vulkan measured on a PS5 (firmware 13.40) that
sceVideoOutRegisterBuffers2 refuses a set at buffers 15 to 19 with
0x80290001. The call threw instead. The other out-of-range arguments
keep throwing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sceVideoOutRegisterBuffers registers a PS4 buffer with tiling mode 0 as a
GCN display buffer with its pitch padded to 128 pixels and refuses tiling
modes above 1, so video_out_flip_ps4 now checks both instead of expecting
tiled PS4 buffers to throw.
sceVideoOutSubmitChangeBufferAttribute2 on a PS4 buffer set computes the
same padded pitch as the registration. Before, a PS4 set changed to tiling
mode 0 kept a pitch of 0 and failed the 128-pixel padding check. The test
changes a PS4 set to tiled, checks its GCN description, and changes it back
to linear.
Real sceGnm shader, state and draw packet writers, submit and
submit-and-flip into the AGC executor, PS4 sync packets lowered to their
PS5 forms, constant engine buffers merged into the draw buffer and the
PS4 graphics EOP event. VideoOut keeps the pitch of tiled PS4 display
buffers and accepts the PS4 10-bit display format. The four tool-state
queries (submissions allowed, user PA, GPU capture, Razor) are silent
stubs listed in the debt file.
Add the PS4 functions sceVideoOutSetBufferAttribute and
sceVideoOutRegisterBuffers on top of the existing registration. The PS4
call uses the first free attribute set and returns its index. It
accepts linear A8R8G8B8_SRGB and A8B8G8R8_SRGB buffers, which map to the
PS5 B8G8R8A8 and R8G8B8A8 formats. It throws for tiled buffers, whose
PS4 layout differs from the PS5 one. Linear PS4 buffers may be 4 KiB
aligned: the OpenOrbis graphics sample places its second 1920x1080
buffer 8,294,400 bytes after the first. PS5 buffers keep the 64 KiB
rule. A handle with PS4 buffers writes the PS4 flip status (64 bytes)
and vblank status (32 bytes). Writing the 128-byte PS5 flip status into
the sample's stack structure overwrote its saved frame pointer.
sceVideoOutSubmitChangeBufferAttribute2 threw when a buffer of the group
had a flip pending, and Marvel's Wolverine makes that call with flips in
the queue. A flip now takes its buffer group when it is reserved, in
submission order, so flips submitted before the change keep the
attributes their buffers were rendered with and later flips use the
new ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Elden Ring Nightreign (PPSA25380) imports the function, which no library
exported, so the title failed to load. The option is ORed into the buffer
attribute and a null attribute throws. Options other than 0 and 8 still
throw when the buffers are registered.
sceVideoOutRegisterBuffers2 threw "DCC presentation is not implemented"
for category 1 (DCC-compressed) buffers, which PPSA26344 registers. Such
a buffer now needs DCC metadata and the tiled layout, and dcc_control may
only use the CB_DCC_CONTROL block layout bits 0x10026c.
At a flip the keys are read behind their recorded writers, one byte per
256 bytes as in the driver's DCC model. Uncompressed keys present the
stored texels as before; a uniform clear code presents its color with a
GPU clear of the scaler's source image; a pending storage image is used
when it serves the keys. Mixed or unreadable keys, clear codes the
display format has no DCC encoding for, register-clear keys over a
pending image and a clear color wider than 32 bits throw. Buffers
without DCC take the old path.
sceVideoOutRegisterBuffers2 and sceVideoOutSubmitChangeBufferAttribute2
threw for every buffer attribute option other than 0. PPSA26344 builds
its display buffers with option 8 through the libSceAgc helper linked
into it, so its first registration failed.
Option 8, VIDEO_OUT_BUFFER_ATTRIBUTE_OPTION_STRICT_COLORIMETRY (name
and value from KytyPS5), is now accepted and presented as option 0;
every other option still throws. What the console changes for it is
unknown and recorded in TechnicalDebt. The rejection now names the
tiling mode, pitch, aspect ratio and option it was given.
video_out_flip_tests decode checks that option 8 describes the same
buffer as option 0 and that options 1, 32 and 40 are rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>