Add support for multithreading in softgpu.

This commit is contained in:
Unknown W. Brackets
2013-08-17 09:52:35 -07:00
parent f501c98a5d
commit a4bea9c878
2 changed files with 20 additions and 0 deletions
+16
View File
@@ -212,6 +212,11 @@ void CopyToCurrentFboFromRam(u8* data, int srcwidth, int srcheight, int dstwidth
}
void SoftGPU::CopyDisplayToOutput()
{
ScheduleEvent(GPU_EVENT_COPY_DISPLAY_TO_OUTPUT);
}
void SoftGPU::CopyDisplayToOutputInternal()
{
// TODO: How to get the correct dimensions?
CopyToCurrentFboFromRam(fb, gstate.fbwidth & 0x3C0, FB_HEIGHT, PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight);
@@ -227,6 +232,17 @@ u32 SoftGPU::DrawSync(int mode)
return GPUCommon::DrawSync(mode);
}
void SoftGPU::ProcessEvent(GPUEvent ev) {
switch (ev.type) {
case GPU_EVENT_COPY_DISPLAY_TO_OUTPUT:
CopyDisplayToOutputInternal();
break;
default:
GPUCommon::ProcessEvent(ev);
}
}
void SoftGPU::FastRunLoop(DisplayList &list) {
for (; downcount > 0; --downcount) {
u32 op = Memory::ReadUnchecked_U32(list.pc);
+4
View File
@@ -49,4 +49,8 @@ public:
protected:
virtual void FastRunLoop(DisplayList &list);
virtual void ProcessEvent(GPUEvent ev);
private:
void CopyDisplayToOutputInternal();
};