From 3ae7c5b23c70fa258fd79a85d3ac50c2a19dd00e Mon Sep 17 00:00:00 2001 From: tfarley Date: Sat, 18 Apr 2015 19:26:09 -0400 Subject: [PATCH] Moved vertex processor invocation into renderer --- src/video_core/command_processor.cpp | 6 +++--- src/video_core/renderer_base.h | 3 +++ src/video_core/renderer_opengl/renderer_opengl.cpp | 7 +++++++ src/video_core/renderer_opengl/renderer_opengl.h | 3 +++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index bc1cc9ada..9f7990036 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -4,12 +4,12 @@ #include "common/profiler.h" -#include "clipper.h" #include "command_processor.h" #include "pica.h" -#include "vertex_processor.h" +#include "vertex_shader.h" #include "core/hle/service/gsp_gpu.h" #include "core/hw/gpu.h" +#include "video_core.h" #include "debug_utils/debug_utils.h" @@ -57,7 +57,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { DebugUtils::DumpTevStageConfig(registers.GetTevStages()); - Pica::VertexProcessor::ProcessBatch(id == PICA_REG_INDEX(trigger_draw_indexed), Clipper::ProcessTriangle); + VideoCore::g_renderer->DrawBatch(id == PICA_REG_INDEX(trigger_draw_indexed)); break; } diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index b77f29c11..42bc12540 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -37,6 +37,9 @@ public: /// Shutdown the renderer virtual void ShutDown() = 0; + /// Draw a batch of triangles + virtual void DrawBatch(bool is_indexed) = 0; + // Getter/setter functions: // ------------------------ diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 5e864b75e..cc3dbdc29 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -11,6 +11,8 @@ #include "common/emu_window.h" #include "common/profiler_reporting.h" +#include "video_core/clipper.h" +#include "video_core/vertex_processor.h" #include "video_core/video_core.h" #include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/renderer_opengl/gl_shader_util.h" @@ -342,3 +344,8 @@ void RendererOpenGL::Init() { /// Shutdown the renderer void RendererOpenGL::ShutDown() { } + +/// Draw a batch of triangles +void RendererOpenGL::DrawBatch(bool is_indexed) { + Pica::VertexProcessor::ProcessBatch(is_indexed, Pica::Clipper::ProcessTriangle); +} diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index cd782428e..79159c130 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -37,6 +37,9 @@ public: /// Shutdown the renderer void ShutDown() override; + /// Draw a batch of triangles + void DrawBatch(bool is_indexed) override; + private: /// Structure used for storing information about the textures for each 3DS screen struct TextureInfo {