diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/command_processor.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_base.h | 18 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 2f92be661..2274dfa66 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -142,7 +142,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 142 | // Send to renderer | 142 | // Send to renderer |
| 143 | using Pica::Shader::OutputVertex; | 143 | using Pica::Shader::OutputVertex; |
| 144 | auto AddTriangle = [](const OutputVertex& v0, const OutputVertex& v1, const OutputVertex& v2) { | 144 | auto AddTriangle = [](const OutputVertex& v0, const OutputVertex& v1, const OutputVertex& v2) { |
| 145 | VideoCore::g_renderer->rasterizer->AddTriangle(v0, v1, v2); | 145 | VideoCore::g_renderer->Rasterizer()->AddTriangle(v0, v1, v2); |
| 146 | }; | 146 | }; |
| 147 | 147 | ||
| 148 | g_state.immediate.primitive_assembler.SubmitVertex(output, AddTriangle); | 148 | g_state.immediate.primitive_assembler.SubmitVertex(output, AddTriangle); |
| @@ -155,7 +155,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 155 | case PICA_REG_INDEX(gpu_mode): | 155 | case PICA_REG_INDEX(gpu_mode): |
| 156 | if (regs.gpu_mode == Regs::GPUMode::Configuring && regs.vs_default_attributes_setup.index == 15) { | 156 | if (regs.gpu_mode == Regs::GPUMode::Configuring && regs.vs_default_attributes_setup.index == 15) { |
| 157 | // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring | 157 | // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring |
| 158 | VideoCore::g_renderer->rasterizer->DrawTriangles(); | 158 | VideoCore::g_renderer->Rasterizer()->DrawTriangles(); |
| 159 | } | 159 | } |
| 160 | break; | 160 | break; |
| 161 | 161 | ||
| @@ -396,7 +396,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 396 | using Pica::Shader::OutputVertex; | 396 | using Pica::Shader::OutputVertex; |
| 397 | auto AddTriangle = []( | 397 | auto AddTriangle = []( |
| 398 | const OutputVertex& v0, const OutputVertex& v1, const OutputVertex& v2) { | 398 | const OutputVertex& v0, const OutputVertex& v1, const OutputVertex& v2) { |
| 399 | VideoCore::g_renderer->rasterizer->AddTriangle(v0, v1, v2); | 399 | VideoCore::g_renderer->Rasterizer()->AddTriangle(v0, v1, v2); |
| 400 | }; | 400 | }; |
| 401 | 401 | ||
| 402 | primitive_assembler.SubmitVertex(output, AddTriangle); | 402 | primitive_assembler.SubmitVertex(output, AddTriangle); |
| @@ -407,7 +407,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 407 | range.second, range.first); | 407 | range.second, range.first); |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | VideoCore::g_renderer->rasterizer->DrawTriangles(); | 410 | VideoCore::g_renderer->Rasterizer()->DrawTriangles(); |
| 411 | 411 | ||
| 412 | #if PICA_DUMP_GEOMETRY | 412 | #if PICA_DUMP_GEOMETRY |
| 413 | geometry_dumper.Dump(); | 413 | geometry_dumper.Dump(); |
| @@ -542,7 +542,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 542 | break; | 542 | break; |
| 543 | } | 543 | } |
| 544 | 544 | ||
| 545 | VideoCore::g_renderer->rasterizer->NotifyPicaRegisterChanged(id); | 545 | VideoCore::g_renderer->Rasterizer()->NotifyPicaRegisterChanged(id); |
| 546 | 546 | ||
| 547 | if (g_debug_context) | 547 | if (g_debug_context) |
| 548 | g_debug_context->OnEvent(DebugContext::Event::PicaCommandProcessed, reinterpret_cast<void*>(&id)); | 548 | g_debug_context->OnEvent(DebugContext::Event::PicaCommandProcessed, reinterpret_cast<void*>(&id)); |
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 6e21caa78..271e81ca1 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -48,7 +48,7 @@ void DebugContext::OnEvent(Event event, void* data) { | |||
| 48 | std::unique_lock<std::mutex> lock(breakpoint_mutex); | 48 | std::unique_lock<std::mutex> lock(breakpoint_mutex); |
| 49 | 49 | ||
| 50 | // Commit the hardware renderer's framebuffer so it will show on debug widgets | 50 | // Commit the hardware renderer's framebuffer so it will show on debug widgets |
| 51 | VideoCore::g_renderer->rasterizer->FlushFramebuffer(); | 51 | VideoCore::g_renderer->Rasterizer()->FlushFramebuffer(); |
| 52 | 52 | ||
| 53 | // TODO: Should stop the CPU thread here once we multithread emulation. | 53 | // TODO: Should stop the CPU thread here once we multithread emulation. |
| 54 | 54 | ||
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index 91a7b7f17..f68091cc8 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h | |||
| @@ -22,9 +22,6 @@ public: | |||
| 22 | kFramebuffer_Texture | 22 | kFramebuffer_Texture |
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | RendererBase() : m_current_fps(0), m_current_frame(0) { | ||
| 26 | } | ||
| 27 | |||
| 28 | virtual ~RendererBase() { | 25 | virtual ~RendererBase() { |
| 29 | } | 26 | } |
| 30 | 27 | ||
| @@ -46,21 +43,24 @@ public: | |||
| 46 | // Getter/setter functions: | 43 | // Getter/setter functions: |
| 47 | // ------------------------ | 44 | // ------------------------ |
| 48 | 45 | ||
| 49 | f32 GetCurrentframe() const { | 46 | f32 GetCurrentFPS() const { |
| 50 | return m_current_fps; | 47 | return m_current_fps; |
| 51 | } | 48 | } |
| 52 | 49 | ||
| 53 | int current_frame() const { | 50 | int GetCurrentFrame() const { |
| 54 | return m_current_frame; | 51 | return m_current_frame; |
| 55 | } | 52 | } |
| 56 | 53 | ||
| 57 | void RefreshRasterizerSetting(); | 54 | VideoCore::RasterizerInterface* Rasterizer() const { |
| 55 | return rasterizer.get(); | ||
| 56 | } | ||
| 58 | 57 | ||
| 59 | std::unique_ptr<VideoCore::RasterizerInterface> rasterizer; | 58 | void RefreshRasterizerSetting(); |
| 60 | 59 | ||
| 61 | protected: | 60 | protected: |
| 62 | f32 m_current_fps; ///< Current framerate, should be set by the renderer | 61 | std::unique_ptr<VideoCore::RasterizerInterface> rasterizer; |
| 63 | int m_current_frame; ///< Current frame, should be set by the renderer | 62 | f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer |
| 63 | int m_current_frame = 0; ///< Current frame, should be set by the renderer | ||
| 64 | 64 | ||
| 65 | private: | 65 | private: |
| 66 | bool opengl_rasterizer_active = false; | 66 | bool opengl_rasterizer_active = false; |