summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar James Rowe2017-09-07 22:05:42 -0600
committerGravatar James Rowe2017-09-11 09:21:43 -0600
commitad0b57f4071fb7ec9da764b3905e0bb5e4c5eef2 (patch)
tree851981b5f2ac95e770916b199737fd421258d1e5 /src
parentMerge pull request #2865 from wwylele/gs++ (diff)
downloadyuzu-ad0b57f4071fb7ec9da764b3905e0bb5e4c5eef2.tar.gz
yuzu-ad0b57f4071fb7ec9da764b3905e0bb5e4c5eef2.tar.xz
yuzu-ad0b57f4071fb7ec9da764b3905e0bb5e4c5eef2.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/command_processor.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index fb65a3a0a..fff159058 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -243,6 +243,15 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
243 ASSERT(!g_state.geometry_pipeline.NeedIndexInput()); 243 ASSERT(!g_state.geometry_pipeline.NeedIndexInput());
244 g_state.geometry_pipeline.Setup(shader_engine); 244 g_state.geometry_pipeline.Setup(shader_engine);
245 g_state.geometry_pipeline.SubmitVertex(output); 245 g_state.geometry_pipeline.SubmitVertex(output);
246
247 // TODO: If drawing after every immediate mode triangle kills performance,
248 // change it to flush triangles whenever a draing config register changes
249 // See: https://github.com/citra-emu/citra/pull/2866#issuecomment-327011550
250 VideoCore::g_renderer->Rasterizer()->DrawTriangles();
251 if (g_debug_context) {
252 g_debug_context->OnEvent(DebugContext::Event::FinishedPrimitiveBatch,
253 nullptr);
254 }
246 } 255 }
247 } 256 }
248 } 257 }
@@ -398,6 +407,12 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
398 range.second, range.first); 407 range.second, range.first);
399 } 408 }
400 409
410 MICROPROFILE_SCOPE(GPU_Drawing);
411 VideoCore::g_renderer->Rasterizer()->DrawTriangles();
412 if (g_debug_context) {
413 g_debug_context->OnEvent(DebugContext::Event::FinishedPrimitiveBatch, nullptr);
414 }
415
401 break; 416 break;
402 } 417 }
403 418
@@ -632,6 +647,6 @@ void ProcessCommandList(const u32* list, u32 size) {
632 } 647 }
633} 648}
634 649
635} // namespace 650} // namespace CommandProcessor
636 651
637} // namespace 652} // namespace Pica