diff --git a/GPU/Vulkan/DrawEngineVulkan.h b/GPU/Vulkan/DrawEngineVulkan.h index fdcce0a73c..d33653d2ef 100644 --- a/GPU/Vulkan/DrawEngineVulkan.h +++ b/GPU/Vulkan/DrawEngineVulkan.h @@ -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); diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 371a55fe92..665c912c90 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -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) {