GPU/HW: Fix another buffer unmapping case

This commit is contained in:
Stenzek 2024-03-08 21:15:53 +10:00
parent de1338cbbc
commit 8fe86ff690
No known key found for this signature in database

View file

@ -294,8 +294,7 @@ bool GPU_HW::DoState(StateWrapper& sw, GPUTexture** host_texture, bool update_di
// invalidate the whole VRAM read texture when loading state // invalidate the whole VRAM read texture when loading state
if (sw.IsReading()) if (sw.IsReading())
{ {
if (m_batch_vertex_ptr) DebugAssert(!m_batch_vertex_ptr && !m_batch_index_ptr);
UnmapGPUBuffer(0, 0);
SetFullVRAMDirtyRectangle(); SetFullVRAMDirtyRectangle();
ResetBatchVertexDepth(); ResetBatchVertexDepth();
} }
@ -2492,7 +2491,7 @@ void GPU_HW::EnsureVertexBufferSpaceForCurrentCommand()
// can we fit these vertices in the current depth buffer range? // can we fit these vertices in the current depth buffer range?
if ((m_current_depth + required_vertices) > MAX_BATCH_VERTEX_COUNTER_IDS) if ((m_current_depth + required_vertices) > MAX_BATCH_VERTEX_COUNTER_IDS)
{ {
// implies FlushRender() FlushRender();
ResetBatchVertexDepth(); ResetBatchVertexDepth();
MapGPUBuffer(required_vertices, required_indices); MapGPUBuffer(required_vertices, required_indices);
return; return;
@ -2507,7 +2506,6 @@ void GPU_HW::ResetBatchVertexDepth()
return; return;
Log_PerfPrint("Resetting batch vertex depth"); Log_PerfPrint("Resetting batch vertex depth");
FlushRender();
UpdateDepthBufferFromMaskBit(); UpdateDepthBufferFromMaskBit();
m_current_depth = 1; m_current_depth = 1;