video_out: added display buffer labels

This commit is contained in:
psucien 2024-05-08 07:35:10 +02:00
parent 4206ec3c94
commit 50bcd13482
3 changed files with 10 additions and 0 deletions

View file

@ -19,6 +19,8 @@ struct VideoOutPort {
bool is_open = false;
SceVideoOutResolutionStatus resolution;
std::array<VideoOutBuffer, MaxDisplayBuffers> buffer_slots;
std::array<uintptr_t, MaxDisplayBuffers> buffer_labels; // should be contiguous in memory
static_assert(sizeof(buffer_labels[0]) == 8u);
std::array<BufferAttributeGroup, MaxDisplayBufferGroups> groups;
FlipStatus flip_status;
SceVideoOutVblankStatus vblank_status;

View file

@ -210,6 +210,12 @@ void Vblank() {
return driver->Vblank();
}
void sceVideoOutGetBufferLabelAddress(s32 handle, uintptr_t* label_addr) {
auto* port = driver->GetPort(handle);
ASSERT(port);
*label_addr = reinterpret_cast<uintptr_t>(port->buffer_labels.data());
}
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
driver = std::make_unique<VideoOutDriver>(Config::getScreenWidth(), Config::getScreenHeight());

View file

@ -102,6 +102,8 @@ s32 PS4_SYSV_ABI sceVideoOutClose(s32 handle);
void Flip(std::chrono::microseconds micros);
void Vblank();
void sceVideoOutGetBufferLabelAddress(s32 handle, uintptr_t* label_addr);
void RegisterLib(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::VideoOut