GPU/HW: Always unmap buffer on flush

Should stop assertions firing in some games.
This commit is contained in:
Connor McLaughlin
2020-03-07 12:34:40 +10:00
parent ef2796b780
commit ae4767a9ca
3 changed files with 23 additions and 16 deletions

View File

@ -639,18 +639,20 @@ void GPU_HW_OpenGL_ES::UpdateVRAMReadTexture()
void GPU_HW_OpenGL_ES::FlushRender()
{
static constexpr std::array<GLenum, 4> gl_primitives = {{GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP}};
if (!m_batch_current_vertex_ptr)
return;
const u32 vertex_count = GetBatchVertexCount();
m_batch_start_vertex_ptr = nullptr;
m_batch_end_vertex_ptr = nullptr;
m_batch_current_vertex_ptr = nullptr;
if (vertex_count == 0)
return;
m_renderer_stats.num_batches++;
m_batch_start_vertex_ptr = nullptr;
m_batch_end_vertex_ptr = nullptr;
m_batch_current_vertex_ptr = nullptr;
static constexpr std::array<GLenum, 4> gl_primitives = {{GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP}};
if (m_batch.NeedsTwoPassRendering())
{
SetDrawState(BatchRenderMode::OnlyTransparent);