diff options
| author | bunnei <bunneidev@gmail.com> | 2018-08-17 00:07:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-17 00:07:06 -0400 |
| commit | 727136a9c941e11f98ada3a972e860d2d945d96f (patch) | |
| tree | 6ee9b1dfda590eaa0cc8bf906c262a07ff82de9f /src/video_core/engines/maxwell_3d.cpp | |
| parent | 0d9b3e425e565d1520ae4c4d0f4302a52c5d6751 (diff) | |
| parent | c5284efd4f04bca05b1f5c61dce59090a7edf61e (diff) | |
Merge pull request #1019 from Subv/vertex_divisor
Rasterizer: Manually implemented instanced rendering.
Diffstat (limited to 'src/video_core/engines/maxwell_3d.cpp')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 12 |
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); |
