diff options
author | FengChen <vonchenplus@gmail.com> | 2022-12-08 15:03:14 +0100 |
---|---|---|
committer | FengChen <vonchenplus@gmail.com> | 2022-12-08 15:40:28 +0100 |
commit | 15d63c3d3d0f70efe470eef2b295d6c4bc3bce19 (patch) | |
tree | 18d26dc8f8b3e93c869041a3fe6bae07d1a78f0e /src | |
parent | Merge pull request #9401 from vonchenplus/draw_manager (diff) | |
download | yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.tar yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.tar.gz yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.tar.bz2 yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.tar.lz yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.tar.xz yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.tar.zst yuzu-15d63c3d3d0f70efe470eef2b295d6c4bc3bce19.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/engines/draw_manager.cpp | 42 | ||||
-rw-r--r-- | src/video_core/engines/draw_manager.h | 4 |
2 files changed, 23 insertions, 23 deletions
diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index c59524e58..36e4ec89d 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -46,9 +46,6 @@ void DrawManager::ProcessMethodCall(u32 method, u32 argument) { SetInlineIndexBuffer(regs.inline_index_4x8.index2); SetInlineIndexBuffer(regs.inline_index_4x8.index3); break; - case MAXWELL3D_REG_INDEX(topology_override): - use_topology_override = true; - break; default: break; } @@ -156,25 +153,28 @@ void DrawManager::DrawIndexSmall(u32 argument) { ProcessDraw(true, 1); } -void DrawManager::ProcessTopologyOverride() { - if (!use_topology_override) - return; - +void DrawManager::UpdateTopology() { const auto& regs{maxwell3d->regs}; - switch (regs.topology_override) { - case PrimitiveTopologyOverride::None: - break; - case PrimitiveTopologyOverride::Points: - draw_state.topology = PrimitiveTopology::Points; + switch (regs.primitive_topology_control) { + case PrimitiveTopologyControl::UseInBeginMethods: break; - case PrimitiveTopologyOverride::Lines: - draw_state.topology = PrimitiveTopology::Lines; - break; - case PrimitiveTopologyOverride::LineStrip: - draw_state.topology = PrimitiveTopology::LineStrip; - break; - default: - draw_state.topology = static_cast<PrimitiveTopology>(regs.topology_override); + case PrimitiveTopologyControl::UseSeparateState: + switch (regs.topology_override) { + case PrimitiveTopologyOverride::None: + break; + case PrimitiveTopologyOverride::Points: + draw_state.topology = PrimitiveTopology::Points; + break; + case PrimitiveTopologyOverride::Lines: + draw_state.topology = PrimitiveTopology::Lines; + break; + case PrimitiveTopologyOverride::LineStrip: + draw_state.topology = PrimitiveTopology::LineStrip; + break; + default: + draw_state.topology = static_cast<PrimitiveTopology>(regs.topology_override); + break; + } break; } } @@ -183,7 +183,7 @@ void DrawManager::ProcessDraw(bool draw_indexed, u32 instance_count) { LOG_TRACE(HW_GPU, "called, topology={}, count={}", draw_state.topology.Value(), draw_indexed ? draw_state.index_buffer.count : draw_state.vertex_buffer.count); - ProcessTopologyOverride(); + UpdateTopology(); if (maxwell3d->ShouldExecute()) maxwell3d->rasterizer->Draw(draw_indexed, instance_count); diff --git a/src/video_core/engines/draw_manager.h b/src/video_core/engines/draw_manager.h index 4f67027ca..0e6930a9c 100644 --- a/src/video_core/engines/draw_manager.h +++ b/src/video_core/engines/draw_manager.h @@ -10,6 +10,7 @@ class RasterizerInterface; } namespace Tegra::Engines { +using PrimitiveTopologyControl = Maxwell3D::Regs::PrimitiveTopologyControl; using PrimitiveTopology = Maxwell3D::Regs::PrimitiveTopology; using PrimitiveTopologyOverride = Maxwell3D::Regs::PrimitiveTopologyOverride; using IndexBuffer = Maxwell3D::Regs::IndexBuffer; @@ -58,12 +59,11 @@ private: void DrawIndexSmall(u32 argument); - void ProcessTopologyOverride(); + void UpdateTopology(); void ProcessDraw(bool draw_indexed, u32 instance_count); Maxwell3D* maxwell3d{}; State draw_state{}; - bool use_topology_override{}; }; } // namespace Tegra::Engines |