some video buffer work

This commit is contained in:
georgemoralis 2023-09-22 10:38:21 +03:00
parent 12382ddac4
commit f469296b78
7 changed files with 34 additions and 3 deletions

View file

@ -4,6 +4,6 @@
namespace GPU {
enum class MemoryMode : u32 { NoAccess = 0, Read = 1, Write = 2, ReadWrite = 3 };
enum class MemoryObjectType : u64 { InvalidObj, VideoOutBufferObj };
void MemorySetAllocArea(u64 virtual_addr, u64 size);
}
} // namespace GPU

View file

View file

@ -0,0 +1,12 @@
#pragma once
#include <types.h>
namespace GPU {
enum class VideoOutBufferFormat : u64 {
Unknown,
R8G8B8A8Srgb,
B8G8R8A8Srgb,
};
}

View file

@ -17,6 +17,7 @@ struct VideoConfigInternal {
std::vector<HLE::Libs::LibKernel::EventQueues::SceKernelEqueue> m_flip_evtEq;
int m_flip_rate = 0;
std::vector<VideoOutBufferSetInternal> buffers_sets;
int buffers_registration_index = 0;
};

View file

@ -165,6 +165,17 @@ s32 PS4_SYSV_ABI sceVideoOutRegisterBuffers(s32 handle, s32 startIndex, void* co
u64 buffer_size = 1280 * 720 * 4; //TODO hardcoded value should be redone
u64 buffer_pitch = attribute->pitchInPixel;
VideoOutBufferSetInternal buf{};
buf.start_index = startIndex;
buf.num = bufferNum;
buf.set_id = registration_index;
buf.attr = *attribute;
ctx->buffers_sets.push_back(buf);
return registration_index;
}
s32 PS4_SYSV_ABI sceVideoOutSetFlipRate(s32 handle, s32 rate) {

View file

@ -87,6 +87,13 @@ struct SceVideoOutVblankStatus {
u08 pad1[7] = {};
};
struct VideoOutBufferSetInternal {
SceVideoOutBufferAttribute attr;
int start_index = 0;
int num = 0;
int set_id = 0;
};
void videoOutInit(u32 width, u32 height);
std::string getPixelFormatString(s32 format);
void videoOutRegisterLib(SymbolsResolver* sym);