mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 16:43:05 -05:00
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.
25 lines
1.6 KiB
C++
25 lines
1.6 KiB
C++
#ifndef CORE_LIBS_PRX_LIBSCEVIDEOUOUT_INCLUDE_BUFFER_HPP
|
|
#define CORE_LIBS_PRX_LIBSCEVIDEOUOUT_INCLUDE_BUFFER_HPP
|
|
|
|
#include <cstdint>
|
|
|
|
#include "prx/libc/include/General.hpp"
|
|
#include "SceTypes.hpp"
|
|
|
|
extern "C" {
|
|
|
|
int APS5_VABI sceVideoOutRegisterBuffers(int handle, int buffer_index_start, void* const* addresses, int buffer_num, const VideoOutBufferAttribute* attribute);
|
|
void APS5_VABI sceVideoOutSetBufferAttribute(VideoOutBufferAttribute* attribute, uint32_t pixel_format, uint32_t tiling_mode, uint32_t aspect_ratio, uint32_t width, uint32_t height, uint32_t pitch_in_pixel);
|
|
int APS5_VABI sceVideoOutRegisterBuffers2(int handle, int set_index, int buffer_index_start, const VideoOutBuffers* buffers, int buffer_num, const VideoOutBufferAttribute2* attribute, int category, void* option);
|
|
void APS5_VABI sceVideoOutSetBufferAttribute2(VideoOutBufferAttribute2* attribute, uint64_t pixel_format, uint32_t tiling_mode, uint32_t width, uint32_t height, uint64_t option, uint32_t dcc_control, uint64_t dcc_cb_register_clear_color);
|
|
void APS5_VABI sceVideoOutAddBufferAttributeOption(VideoOutBufferAttribute2* attribute, uint64_t option);
|
|
int APS5_VABI sceVideoOutSubmitChangeBufferAttribute2(int handle, int set_index, const VideoOutBufferAttribute2* attribute, void* option);
|
|
int APS5_VABI sceVideoOutSubmitEopFlip(int handle, int index, int flip_mode, int64_t flip_arg, std::uint32_t* token);
|
|
int APS5_VABI sceVideoOutSubmitFlip(int handle, int index, int flip_mode, int64_t flip_arg);
|
|
int APS5_VABI sceVideoOutUnregisterBuffers(int handle, int set_index);
|
|
int APS5_VABI sceVideoOutGetBufferLabelAddress(int handle, uintptr_t* address);
|
|
|
|
#endif
|
|
|
|
}
|