mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
GPU: Add draw for immediate and batch modes
PR #1461 introduced a regression where some games would change configuration even while in the poorly named "drawing" mode, which broke the heuristic citra was using to determine when to draw the batch. This change adds back in a draw call for batching, and also adds in a draw call in immediate mode each time it adds a triangle.
This commit is contained in:
parent
11baa40d75
commit
ad0b57f407
1 changed files with 17 additions and 2 deletions
|
@ -243,6 +243,15 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
|
||||||
ASSERT(!g_state.geometry_pipeline.NeedIndexInput());
|
ASSERT(!g_state.geometry_pipeline.NeedIndexInput());
|
||||||
g_state.geometry_pipeline.Setup(shader_engine);
|
g_state.geometry_pipeline.Setup(shader_engine);
|
||||||
g_state.geometry_pipeline.SubmitVertex(output);
|
g_state.geometry_pipeline.SubmitVertex(output);
|
||||||
|
|
||||||
|
// TODO: If drawing after every immediate mode triangle kills performance,
|
||||||
|
// change it to flush triangles whenever a draing config register changes
|
||||||
|
// See: https://github.com/citra-emu/citra/pull/2866#issuecomment-327011550
|
||||||
|
VideoCore::g_renderer->Rasterizer()->DrawTriangles();
|
||||||
|
if (g_debug_context) {
|
||||||
|
g_debug_context->OnEvent(DebugContext::Event::FinishedPrimitiveBatch,
|
||||||
|
nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -398,6 +407,12 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
|
||||||
range.second, range.first);
|
range.second, range.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MICROPROFILE_SCOPE(GPU_Drawing);
|
||||||
|
VideoCore::g_renderer->Rasterizer()->DrawTriangles();
|
||||||
|
if (g_debug_context) {
|
||||||
|
g_debug_context->OnEvent(DebugContext::Event::FinishedPrimitiveBatch, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,6 +647,6 @@ void ProcessCommandList(const u32* list, u32 size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace CommandProcessor
|
||||||
|
|
||||||
} // namespace
|
} // namespace Pica
|
||||||
|
|
Loading…
Reference in a new issue