Vulkan: Flush at display list waits. Fixes #10095

This commit is contained in:
Henrik Rydgård 2017-11-16 16:27:24 +01:00
parent a0414a6176
commit a56d6f2399
2 changed files with 17 additions and 5 deletions

View File

@ -147,6 +147,15 @@ public:
DoFlush();
}
void FinishDeferred() {
if (!numDrawCalls)
return;
// Decode any pending vertices. And also flush while we're at it, for simplicity.
// It might be possible to only decode like in the other backends, but meh, it can't matter.
// Issue #10095 has a nice example of where this is required.
DoFlush();
}
void DispatchFlush() override { Flush(); }
void DispatchSubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int *bytesRead) override {
SubmitPrim(verts, inds, prim, vertexCount, vertType, bytesRead);

View File

@ -462,6 +462,7 @@ void GPU_Vulkan::FastRunLoop(DisplayList &list) {
}
void GPU_Vulkan::FinishDeferred() {
drawEngine_.FinishDeferred();
}
inline void GPU_Vulkan::CheckFlushOp(int cmd, u32 diff) {
@ -533,12 +534,14 @@ void GPU_Vulkan::Execute_Prim(u32 op, u32 diff) {
void *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
void *inds = 0;
u32 vertexType = gstate.vertType;
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
ERROR_LOG_REPORT(G3D, "Bad index address %08x!", gstate_c.indexAddr);
u32 indexAddr = gstate_c.indexAddr;
if (!Memory::IsValidAddress(indexAddr)) {
ERROR_LOG_REPORT(G3D, "Bad index address %08x!", indexAddr);
return;
}
inds = Memory::GetPointerUnchecked(gstate_c.indexAddr);
inds = Memory::GetPointerUnchecked(indexAddr);
}
#ifndef MOBILE_DEVICE
@ -555,12 +558,12 @@ void GPU_Vulkan::Execute_Prim(u32 op, u32 diff) {
int bytesRead = 0;
UpdateUVScaleOffset();
drawEngine_.SubmitPrim(verts, inds, prim, count, gstate.vertType, &bytesRead);
drawEngine_.SubmitPrim(verts, inds, prim, count, vertexType, &bytesRead);
// After drawing, we advance the vertexAddr (when non indexed) or indexAddr (when indexed).
// Some games rely on this, they don't bother reloading VADDR and IADDR.
// The VADDR/IADDR registers are NOT updated.
AdvanceVerts(gstate.vertType, count, bytesRead);
AdvanceVerts(vertexType, count, bytesRead);
}
void GPU_Vulkan::Execute_LoadClut(u32 op, u32 diff) {