diff options
| author | 2020-02-19 16:13:50 -0500 | |
|---|---|---|
| committer | 2020-02-19 16:13:50 -0500 | |
| commit | b2bc7682b4f4fab68b49d51b50f8930f1ccdb157 (patch) | |
| tree | d5c22b625e6cb0c734725c4db57dd51301585011 | |
| parent | Merge pull request #3411 from ReinUsesLisp/specific-funcs (diff) | |
| parent | maxwell_3d: Unify draw methods (diff) | |
| download | yuzu-b2bc7682b4f4fab68b49d51b50f8930f1ccdb157.tar.gz yuzu-b2bc7682b4f4fab68b49d51b50f8930f1ccdb157.tar.xz yuzu-b2bc7682b4f4fab68b49d51b50f8930f1ccdb157.zip | |
Merge pull request #3414 from ReinUsesLisp/maxwell-3d-draw
maxwell_3d: Unify draw methods
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/rasterizer_interface.h | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.h | 5 |
6 files changed, 6 insertions, 36 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 842cdcbcf..b28de1092 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -489,7 +489,7 @@ void Maxwell3D::FlushMMEInlineDraw() { | |||
| 489 | 489 | ||
| 490 | const bool is_indexed = mme_draw.current_mode == MMEDrawMode::Indexed; | 490 | const bool is_indexed = mme_draw.current_mode == MMEDrawMode::Indexed; |
| 491 | if (ShouldExecute()) { | 491 | if (ShouldExecute()) { |
| 492 | rasterizer.DrawMultiBatch(is_indexed); | 492 | rasterizer.Draw(is_indexed, true); |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if | 495 | // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if |
| @@ -654,7 +654,7 @@ void Maxwell3D::DrawArrays() { | |||
| 654 | 654 | ||
| 655 | const bool is_indexed{regs.index_array.count && !regs.vertex_buffer.count}; | 655 | const bool is_indexed{regs.index_array.count && !regs.vertex_buffer.count}; |
| 656 | if (ShouldExecute()) { | 656 | if (ShouldExecute()) { |
| 657 | rasterizer.DrawBatch(is_indexed); | 657 | rasterizer.Draw(is_indexed, false); |
| 658 | } | 658 | } |
| 659 | 659 | ||
| 660 | // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if | 660 | // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if |
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index e9f1436f0..f18eaf4bc 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h | |||
| @@ -35,11 +35,8 @@ class RasterizerInterface { | |||
| 35 | public: | 35 | public: |
| 36 | virtual ~RasterizerInterface() {} | 36 | virtual ~RasterizerInterface() {} |
| 37 | 37 | ||
| 38 | /// Draw the current batch of vertex arrays | 38 | /// Dispatches a draw invocation |
| 39 | virtual bool DrawBatch(bool is_indexed) = 0; | 39 | virtual void Draw(bool is_indexed, bool is_instanced) = 0; |
| 40 | |||
| 41 | /// Draw the current batch of multiple instances of vertex arrays | ||
| 42 | virtual bool DrawMultiBatch(bool is_indexed) = 0; | ||
| 43 | 40 | ||
| 44 | /// Clear the current framebuffer | 41 | /// Clear the current framebuffer |
| 45 | virtual void Clear() = 0; | 42 | virtual void Clear() = 0; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index c9c175846..e1965fb21 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -685,16 +685,6 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) { | |||
| 685 | } | 685 | } |
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | bool RasterizerOpenGL::DrawBatch(bool is_indexed) { | ||
| 689 | Draw(is_indexed, false); | ||
| 690 | return true; | ||
| 691 | } | ||
| 692 | |||
| 693 | bool RasterizerOpenGL::DrawMultiBatch(bool is_indexed) { | ||
| 694 | Draw(is_indexed, true); | ||
| 695 | return true; | ||
| 696 | } | ||
| 697 | |||
| 698 | void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) { | 688 | void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) { |
| 699 | if (device.HasBrokenCompute()) { | 689 | if (device.HasBrokenCompute()) { |
| 700 | return; | 690 | return; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index c772fd4ba..68abe9a21 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -58,8 +58,7 @@ public: | |||
| 58 | ScreenInfo& info); | 58 | ScreenInfo& info); |
| 59 | ~RasterizerOpenGL() override; | 59 | ~RasterizerOpenGL() override; |
| 60 | 60 | ||
| 61 | bool DrawBatch(bool is_indexed) override; | 61 | void Draw(bool is_indexed, bool is_instanced) override; |
| 62 | bool DrawMultiBatch(bool is_indexed) override; | ||
| 63 | void Clear() override; | 62 | void Clear() override; |
| 64 | void DispatchCompute(GPUVAddr code_addr) override; | 63 | void DispatchCompute(GPUVAddr code_addr) override; |
| 65 | void ResetCounter(VideoCore::QueryType type) override; | 64 | void ResetCounter(VideoCore::QueryType type) override; |
| @@ -110,9 +109,6 @@ private: | |||
| 110 | void SetupGlobalMemory(u32 binding, const GLShader::GlobalMemoryEntry& entry, GPUVAddr gpu_addr, | 109 | void SetupGlobalMemory(u32 binding, const GLShader::GlobalMemoryEntry& entry, GPUVAddr gpu_addr, |
| 111 | std::size_t size); | 110 | std::size_t size); |
| 112 | 111 | ||
| 113 | /// Syncs all the state, shaders, render targets and textures setting before a draw call. | ||
| 114 | void Draw(bool is_indexed, bool is_instanced); | ||
| 115 | |||
| 116 | /// Configures the current textures to use for the draw command. | 112 | /// Configures the current textures to use for the draw command. |
| 117 | void SetupDrawTextures(std::size_t stage_index, const Shader& shader); | 113 | void SetupDrawTextures(std::size_t stage_index, const Shader& shader); |
| 118 | 114 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 79aa121ed..31c078f6a 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -295,16 +295,6 @@ RasterizerVulkan::RasterizerVulkan(Core::System& system, Core::Frontend::EmuWind | |||
| 295 | 295 | ||
| 296 | RasterizerVulkan::~RasterizerVulkan() = default; | 296 | RasterizerVulkan::~RasterizerVulkan() = default; |
| 297 | 297 | ||
| 298 | bool RasterizerVulkan::DrawBatch(bool is_indexed) { | ||
| 299 | Draw(is_indexed, false); | ||
| 300 | return true; | ||
| 301 | } | ||
| 302 | |||
| 303 | bool RasterizerVulkan::DrawMultiBatch(bool is_indexed) { | ||
| 304 | Draw(is_indexed, true); | ||
| 305 | return true; | ||
| 306 | } | ||
| 307 | |||
| 308 | void RasterizerVulkan::Draw(bool is_indexed, bool is_instanced) { | 298 | void RasterizerVulkan::Draw(bool is_indexed, bool is_instanced) { |
| 309 | MICROPROFILE_SCOPE(Vulkan_Drawing); | 299 | MICROPROFILE_SCOPE(Vulkan_Drawing); |
| 310 | 300 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index add1ad88c..138903d60 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -105,8 +105,7 @@ public: | |||
| 105 | VKScheduler& scheduler); | 105 | VKScheduler& scheduler); |
| 106 | ~RasterizerVulkan() override; | 106 | ~RasterizerVulkan() override; |
| 107 | 107 | ||
| 108 | bool DrawBatch(bool is_indexed) override; | 108 | void Draw(bool is_indexed, bool is_instanced) override; |
| 109 | bool DrawMultiBatch(bool is_indexed) override; | ||
| 110 | void Clear() override; | 109 | void Clear() override; |
| 111 | void DispatchCompute(GPUVAddr code_addr) override; | 110 | void DispatchCompute(GPUVAddr code_addr) override; |
| 112 | void ResetCounter(VideoCore::QueryType type) override; | 111 | void ResetCounter(VideoCore::QueryType type) override; |
| @@ -143,8 +142,6 @@ private: | |||
| 143 | 142 | ||
| 144 | static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; | 143 | static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; |
| 145 | 144 | ||
| 146 | void Draw(bool is_indexed, bool is_instanced); | ||
| 147 | |||
| 148 | void FlushWork(); | 145 | void FlushWork(); |
| 149 | 146 | ||
| 150 | Texceptions UpdateAttachments(); | 147 | Texceptions UpdateAttachments(); |