Merge pull request #3414 from ReinUsesLisp/maxwell-3d-draw
maxwell_3d: Unify draw methods
This commit is contained in:
		| @@ -489,7 +489,7 @@ void Maxwell3D::FlushMMEInlineDraw() { | |||||||
|  |  | ||||||
|     const bool is_indexed = mme_draw.current_mode == MMEDrawMode::Indexed; |     const bool is_indexed = mme_draw.current_mode == MMEDrawMode::Indexed; | ||||||
|     if (ShouldExecute()) { |     if (ShouldExecute()) { | ||||||
|         rasterizer.DrawMultiBatch(is_indexed); |         rasterizer.Draw(is_indexed, true); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if |     // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if | ||||||
| @@ -654,7 +654,7 @@ void Maxwell3D::DrawArrays() { | |||||||
|  |  | ||||||
|     const bool is_indexed{regs.index_array.count && !regs.vertex_buffer.count}; |     const bool is_indexed{regs.index_array.count && !regs.vertex_buffer.count}; | ||||||
|     if (ShouldExecute()) { |     if (ShouldExecute()) { | ||||||
|         rasterizer.DrawBatch(is_indexed); |         rasterizer.Draw(is_indexed, false); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if |     // TODO(bunnei): Below, we reset vertex count so that we can use these registers to determine if | ||||||
|   | |||||||
| @@ -35,11 +35,8 @@ class RasterizerInterface { | |||||||
| public: | public: | ||||||
|     virtual ~RasterizerInterface() {} |     virtual ~RasterizerInterface() {} | ||||||
|  |  | ||||||
|     /// Draw the current batch of vertex arrays |     /// Dispatches a draw invocation | ||||||
|     virtual bool DrawBatch(bool is_indexed) = 0; |     virtual void Draw(bool is_indexed, bool is_instanced) = 0; | ||||||
|  |  | ||||||
|     /// Draw the current batch of multiple instances of vertex arrays |  | ||||||
|     virtual bool DrawMultiBatch(bool is_indexed) = 0; |  | ||||||
|  |  | ||||||
|     /// Clear the current framebuffer |     /// Clear the current framebuffer | ||||||
|     virtual void Clear() = 0; |     virtual void Clear() = 0; | ||||||
|   | |||||||
| @@ -685,16 +685,6 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| bool RasterizerOpenGL::DrawBatch(bool is_indexed) { |  | ||||||
|     Draw(is_indexed, false); |  | ||||||
|     return true; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| bool RasterizerOpenGL::DrawMultiBatch(bool is_indexed) { |  | ||||||
|     Draw(is_indexed, true); |  | ||||||
|     return true; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) { | void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) { | ||||||
|     if (device.HasBrokenCompute()) { |     if (device.HasBrokenCompute()) { | ||||||
|         return; |         return; | ||||||
|   | |||||||
| @@ -58,8 +58,7 @@ public: | |||||||
|                               ScreenInfo& info); |                               ScreenInfo& info); | ||||||
|     ~RasterizerOpenGL() override; |     ~RasterizerOpenGL() override; | ||||||
|  |  | ||||||
|     bool DrawBatch(bool is_indexed) override; |     void Draw(bool is_indexed, bool is_instanced) override; | ||||||
|     bool DrawMultiBatch(bool is_indexed) override; |  | ||||||
|     void Clear() override; |     void Clear() override; | ||||||
|     void DispatchCompute(GPUVAddr code_addr) override; |     void DispatchCompute(GPUVAddr code_addr) override; | ||||||
|     void ResetCounter(VideoCore::QueryType type) override; |     void ResetCounter(VideoCore::QueryType type) override; | ||||||
| @@ -110,9 +109,6 @@ private: | |||||||
|     void SetupGlobalMemory(u32 binding, const GLShader::GlobalMemoryEntry& entry, GPUVAddr gpu_addr, |     void SetupGlobalMemory(u32 binding, const GLShader::GlobalMemoryEntry& entry, GPUVAddr gpu_addr, | ||||||
|                            std::size_t size); |                            std::size_t size); | ||||||
|  |  | ||||||
|     /// Syncs all the state, shaders, render targets and textures setting before a draw call. |  | ||||||
|     void Draw(bool is_indexed, bool is_instanced); |  | ||||||
|  |  | ||||||
|     /// Configures the current textures to use for the draw command. |     /// Configures the current textures to use for the draw command. | ||||||
|     void SetupDrawTextures(std::size_t stage_index, const Shader& shader); |     void SetupDrawTextures(std::size_t stage_index, const Shader& shader); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -295,16 +295,6 @@ RasterizerVulkan::RasterizerVulkan(Core::System& system, Core::Frontend::EmuWind | |||||||
|  |  | ||||||
| RasterizerVulkan::~RasterizerVulkan() = default; | RasterizerVulkan::~RasterizerVulkan() = default; | ||||||
|  |  | ||||||
| bool RasterizerVulkan::DrawBatch(bool is_indexed) { |  | ||||||
|     Draw(is_indexed, false); |  | ||||||
|     return true; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| bool RasterizerVulkan::DrawMultiBatch(bool is_indexed) { |  | ||||||
|     Draw(is_indexed, true); |  | ||||||
|     return true; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void RasterizerVulkan::Draw(bool is_indexed, bool is_instanced) { | void RasterizerVulkan::Draw(bool is_indexed, bool is_instanced) { | ||||||
|     MICROPROFILE_SCOPE(Vulkan_Drawing); |     MICROPROFILE_SCOPE(Vulkan_Drawing); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -105,8 +105,7 @@ public: | |||||||
|                               VKScheduler& scheduler); |                               VKScheduler& scheduler); | ||||||
|     ~RasterizerVulkan() override; |     ~RasterizerVulkan() override; | ||||||
|  |  | ||||||
|     bool DrawBatch(bool is_indexed) override; |     void Draw(bool is_indexed, bool is_instanced) override; | ||||||
|     bool DrawMultiBatch(bool is_indexed) override; |  | ||||||
|     void Clear() override; |     void Clear() override; | ||||||
|     void DispatchCompute(GPUVAddr code_addr) override; |     void DispatchCompute(GPUVAddr code_addr) override; | ||||||
|     void ResetCounter(VideoCore::QueryType type) override; |     void ResetCounter(VideoCore::QueryType type) override; | ||||||
| @@ -143,8 +142,6 @@ private: | |||||||
|  |  | ||||||
|     static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; |     static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; | ||||||
|  |  | ||||||
|     void Draw(bool is_indexed, bool is_instanced); |  | ||||||
|  |  | ||||||
|     void FlushWork(); |     void FlushWork(); | ||||||
|  |  | ||||||
|     Texceptions UpdateAttachments(); |     Texceptions UpdateAttachments(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user