aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/engines/maxwell_3d.cpp
diff options
context:
space:
mode:
authorSssnowyyy <78863999+Sssnowyyy@users.noreply.github.com>2026-11-02 11:41:26 -0500
committerSssnowyyy <78863999+Sssnowyyy@users.noreply.github.com>2026-11-02 14:53:47 -0500
commit427b9abfdc4898f1aeef978ee6edbdeb336db280 (patch)
tree209aca8236268723c63f9879150d93f2fd6f426e /src/video_core/engines/maxwell_3d.cpp
parent8556e27015ded665ca9a5522071cdeeec20a1575 (diff)
video_core: continue a split instance loop at its own instance index
Writing any register outside the instance loop's own methods now draws the waiting instances first, so the batch sees the base instance it was begun with. When a title writes another register in the middle of a loop, such as a per-instance constant buffer, the loop is drawn in several batches, and each later batch started again at global_base_instance_index with one extra instance, so it used the instance IDs of the first records. Count the instances already drawn for the current loop and start the next batch after them, without the extra first-instance draw. A loop that is not split is drawn exactly as before. Follow-up to 2ad0830d2f and eb99da6072. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
Diffstat (limited to 'src/video_core/engines/maxwell_3d.cpp')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 9731f54584..4ef7d42979 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -342,7 +342,7 @@ void Maxwell3D::ProcessDirtyRegisters(u32 method, u32 argument) {
// the state they were begun with: NVN's draw macros reset the base instance (and its copy in
// c[0][0x644]) right after the loop, before the macro returns.
if (draw_manager.HasDeferredDraw() && !DrawManager::IsInstanceLoopMethod(method)) [[unlikely]] {
- draw_manager.DrawDeferred(*this);
+ draw_manager.DrawDeferred(*this, true);
}
regs.reg_array[method] = argument;
for (auto const& table : dirty.tables)
@@ -537,7 +537,7 @@ void Maxwell3D::CallMultiMethod(Core::System& system, u32 method, const u32* bas
}
// As in ProcessDirtyRegisters: the paths below write without it.
if (draw_manager.HasDeferredDraw() && !DrawManager::IsInstanceLoopMethod(method)) [[unlikely]] {
- draw_manager.DrawDeferred(*this);
+ draw_manager.DrawDeferred(*this, true);
}
switch (method) {
case MAXWELL3D_REG_INDEX(const_buffer.buffer):