diff options
| author | 2022-12-08 22:51:18 +0800 | |
|---|---|---|
| committer | 2022-12-08 23:10:52 +0800 | |
| commit | 1e64b5e2ec798f7d71fec73fc4e8642441e04bb9 (patch) | |
| tree | b2bdc0d7ef6817d13e7c40d1c152a2e4912ed92e /src/video_core/engines | |
| parent | video_core: Adjust topology update logic (diff) | |
| download | yuzu-1e64b5e2ec798f7d71fec73fc4e8642441e04bb9.tar.gz yuzu-1e64b5e2ec798f7d71fec73fc4e8642441e04bb9.tar.xz yuzu-1e64b5e2ec798f7d71fec73fc4e8642441e04bb9.zip | |
video_core: The draw manager manages whether Clear is required.
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/draw_manager.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 36e4ec89d..49a16266e 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp | |||
| @@ -52,12 +52,15 @@ void DrawManager::ProcessMethodCall(u32 method, u32 argument) { | |||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | void DrawManager::Clear(u32 layer_count) { | 54 | void DrawManager::Clear(u32 layer_count) { |
| 55 | maxwell3d->rasterizer->Clear(layer_count); | 55 | if (maxwell3d->ShouldExecute()) { |
| 56 | maxwell3d->rasterizer->Clear(layer_count); | ||
| 57 | } | ||
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | void DrawManager::DrawDeferred() { | 60 | void DrawManager::DrawDeferred() { |
| 59 | if (draw_state.draw_mode != DrawMode::Instance || draw_state.instance_count == 0) | 61 | if (draw_state.draw_mode != DrawMode::Instance || draw_state.instance_count == 0) { |
| 60 | return; | 62 | return; |
| 63 | } | ||
| 61 | DrawEnd(draw_state.instance_count + 1, true); | 64 | DrawEnd(draw_state.instance_count + 1, true); |
| 62 | draw_state.instance_count = 0; | 65 | draw_state.instance_count = 0; |
| 63 | } | 66 | } |
| @@ -112,8 +115,9 @@ void DrawManager::DrawEnd(u32 instance_count, bool force_draw) { | |||
| 112 | const auto& regs{maxwell3d->regs}; | 115 | const auto& regs{maxwell3d->regs}; |
| 113 | switch (draw_state.draw_mode) { | 116 | switch (draw_state.draw_mode) { |
| 114 | case DrawMode::Instance: | 117 | case DrawMode::Instance: |
| 115 | if (!force_draw) | 118 | if (!force_draw) { |
| 116 | break; | 119 | break; |
| 120 | } | ||
| 117 | [[fallthrough]]; | 121 | [[fallthrough]]; |
| 118 | case DrawMode::General: | 122 | case DrawMode::General: |
| 119 | draw_state.base_instance = regs.global_base_instance_index; | 123 | draw_state.base_instance = regs.global_base_instance_index; |
| @@ -185,7 +189,8 @@ void DrawManager::ProcessDraw(bool draw_indexed, u32 instance_count) { | |||
| 185 | 189 | ||
| 186 | UpdateTopology(); | 190 | UpdateTopology(); |
| 187 | 191 | ||
| 188 | if (maxwell3d->ShouldExecute()) | 192 | if (maxwell3d->ShouldExecute()) { |
| 189 | maxwell3d->rasterizer->Draw(draw_indexed, instance_count); | 193 | maxwell3d->rasterizer->Draw(draw_indexed, instance_count); |
| 194 | } | ||
| 190 | } | 195 | } |
| 191 | } // namespace Tegra::Engines | 196 | } // namespace Tegra::Engines |