GPU/HW: Always unmap buffer on flush

Should stop assertions firing in some games.
pull/211/head
Connor McLaughlin 6 years ago
parent ef2796b780
commit ae4767a9ca

@ -723,17 +723,20 @@ void GPU_HW_D3D11::UpdateVRAMReadTexture()
void GPU_HW_D3D11::FlushRender()
{
const u32 vertex_count = GetBatchVertexCount();
if (vertex_count == 0)
if (!m_batch_current_vertex_ptr)
return;
m_renderer_stats.num_batches++;
const u32 vertex_count = GetBatchVertexCount();
m_vertex_stream_buffer.Unmap(m_context.Get(), vertex_count * sizeof(BatchVertex));
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++;
if (m_batch.NeedsTwoPassRendering())
{
SetDrawState(BatchRenderMode::OnlyTransparent);

@ -819,19 +819,21 @@ void GPU_HW_OpenGL::UpdateVRAMReadTexture()
void GPU_HW_OpenGL::FlushRender()
{
const u32 vertex_count = GetBatchVertexCount();
if (vertex_count == 0)
return;
static constexpr std::array<GLenum, 4> gl_primitives = {{GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP}};
m_renderer_stats.num_batches++;
if (!m_batch_current_vertex_ptr)
return;
const u32 vertex_count = GetBatchVertexCount();
m_vertex_stream_buffer->Unmap(vertex_count * sizeof(BatchVertex));
m_vertex_stream_buffer->Bind();
m_batch_start_vertex_ptr = nullptr;
m_batch_end_vertex_ptr = nullptr;
m_batch_current_vertex_ptr = nullptr;
if (vertex_count == 0)
return;
static constexpr std::array<GLenum, 4> gl_primitives = {{GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP}};
m_vertex_stream_buffer->Bind();
m_renderer_stats.num_batches++;
if (m_batch.NeedsTwoPassRendering())
{

@ -639,17 +639,19 @@ void GPU_HW_OpenGL_ES::UpdateVRAMReadTexture()
void GPU_HW_OpenGL_ES::FlushRender()
{
const u32 vertex_count = GetBatchVertexCount();
if (vertex_count == 0)
return;
static constexpr std::array<GLenum, 4> gl_primitives = {{GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP}};
m_renderer_stats.num_batches++;
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;
static constexpr std::array<GLenum, 4> gl_primitives = {{GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP}};
m_renderer_stats.num_batches++;
if (m_batch.NeedsTwoPassRendering())
{

Loading…
Cancel
Save