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; bool is_open = false;
SceVideoOutResolutionStatus resolution; SceVideoOutResolutionStatus resolution;
std::array<VideoOutBuffer, MaxDisplayBuffers> buffer_slots; 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; std::array<BufferAttributeGroup, MaxDisplayBufferGroups> groups;
FlipStatus flip_status; FlipStatus flip_status;
SceVideoOutVblankStatus vblank_status; SceVideoOutVblankStatus vblank_status;

View File

@ -210,6 +210,12 @@ void Vblank() {
return driver->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) { void RegisterLib(Core::Loader::SymbolsResolver* sym) {
driver = std::make_unique<VideoOutDriver>(Config::getScreenWidth(), Config::getScreenHeight()); 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 Flip(std::chrono::microseconds micros);
void Vblank(); void Vblank();
void sceVideoOutGetBufferLabelAddress(s32 handle, uintptr_t* label_addr);
void RegisterLib(Core::Loader::SymbolsResolver* sym); void RegisterLib(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::VideoOut } // namespace Libraries::VideoOut