Read pending vertex data before exiting gpu loop.

Fixes save pictures in Crimson Gem Saga.
This commit is contained in:
Unknown W. Brackets 2015-03-14 18:11:00 -07:00
parent e45daac41c
commit 6b26e1a591
8 changed files with 33 additions and 6 deletions

View File

@ -621,6 +621,11 @@ void DIRECTX9_GPU::FastRunLoop(DisplayList &list) {
}
}
void DIRECTX9_GPU::FinishDeferred() {
// This finishes reading any vertex data that is pending.
transformDraw_.FinishDeferred();
}
void DIRECTX9_GPU::ProcessEvent(GPUEvent ev) {
switch (ev.type) {
case GPU_EVENT_INIT_CLEAR:

View File

@ -144,9 +144,10 @@ public:
void Execute_BoneMtxData(u32 op, u32 diff);
protected:
virtual void FastRunLoop(DisplayList &list);
virtual void ProcessEvent(GPUEvent ev);
virtual void FastLoadBoneMatrix(u32 target);
void FastRunLoop(DisplayList &list) override;
void ProcessEvent(GPUEvent ev) override;
void FastLoadBoneMatrix(u32 target) override;
void FinishDeferred() override;
private:
void UpdateCmdInfo();

View File

@ -171,6 +171,12 @@ public:
DoFlush();
}
void FinishDeferred() {
if (!numDrawCalls)
return;
DecodeVerts();
}
bool IsCodePtrVertexDecoder(const u8 *ptr) const;
protected:

View File

@ -705,6 +705,10 @@ void GLES_GPU::FastRunLoop(DisplayList &list) {
downcount = 0;
}
void GLES_GPU::FinishDeferred() {
// This finishes reading any vertex data that is pending.
transformDraw_.FinishDeferred();
}
void GLES_GPU::ProcessEvent(GPUEvent ev) {
switch (ev.type) {

View File

@ -146,9 +146,10 @@ public:
void Execute_BlockTransferStart(u32 op, u32 diff);
protected:
virtual void FastRunLoop(DisplayList &list);
virtual void ProcessEvent(GPUEvent ev);
virtual void FastLoadBoneMatrix(u32 target);
void FastRunLoop(DisplayList &list) override;
void ProcessEvent(GPUEvent ev) override;
void FastLoadBoneMatrix(u32 target) override;
void FinishDeferred() override;
private:
void Flush() {

View File

@ -174,6 +174,12 @@ public:
DoFlush();
}
void FinishDeferred() {
if (!numDrawCalls)
return;
DecodeVerts();
}
bool IsCodePtrVertexDecoder(const u8 *ptr) const;
protected:

View File

@ -533,6 +533,8 @@ bool GPUCommon::InterpretList(DisplayList &list) {
}
}
FinishDeferred();
// We haven't run the op at list.pc, so it shouldn't count.
if (cycleLastPC != list.pc) {
UpdatePC(list.pc - 4, list.pc);

View File

@ -139,6 +139,8 @@ protected:
virtual bool ShouldExitEventLoop() {
return coreState != CORE_RUNNING;
}
virtual void FinishDeferred() {
}
// Allows early unlocking with a guard. Do not double unlock.
class easy_guard {