summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/maxwell_3d.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-08-12 02:21:31 +0200
committerSubv <subv2112@gmail.com>2018-08-15 05:25:07 +0200
commitc5284efd4f04bca05b1f5c61dce59090a7edf61e (patch)
treea4bf294444c67058812f010d01a60e44aa1c80b6 /src/video_core/engines/maxwell_3d.cpp
parentMerge pull request #1069 from bunnei/vtx-sz (diff)
downloadyuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.tar
yuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.tar.gz
yuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.tar.bz2
yuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.tar.lz
yuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.tar.xz
yuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.tar.zst
yuzu-c5284efd4f04bca05b1f5c61dce59090a7edf61e.zip
Diffstat (limited to 'src/video_core/engines/maxwell_3d.cpp')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index a46ed4bd7..68f91cc75 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -222,6 +222,18 @@ void Maxwell3D::DrawArrays() {
debug_context->OnEvent(Tegra::DebugContext::Event::FinishedPrimitiveBatch, nullptr);
}
+ // Both instance configuration registers can not be set at the same time.
+ ASSERT_MSG(!regs.draw.instance_next || !regs.draw.instance_cont,
+ "Illegal combination of instancing parameters");
+
+ if (regs.draw.instance_next) {
+ // Increment the current instance *before* drawing.
+ state.current_instance += 1;
+ } else if (!regs.draw.instance_cont) {
+ // Reset the current instance to 0.
+ state.current_instance = 0;
+ }
+
const bool is_indexed{regs.index_array.count && !regs.vertex_buffer.count};
rasterizer.AccelerateDrawBatch(is_indexed);