summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2016-03-09 10:57:38 -0500
committerGravatar bunnei2016-03-09 10:57:38 -0500
commit4a2d1571bc16e4705c35bc3473985c5e7c8e7603 (patch)
tree8a67bad721611c3b574c78175ddf3f0fae537cd0 /src
parentMerge pull request #1344 from LittleWhite-tb/error-output (diff)
parentrenderer_base: In-class initialize variables (diff)
downloadyuzu-4a2d1571bc16e4705c35bc3473985c5e7c8e7603.tar.gz
yuzu-4a2d1571bc16e4705c35bc3473985c5e7c8e7603.tar.xz
yuzu-4a2d1571bc16e4705c35bc3473985c5e7c8e7603.zip
Merge pull request #1474 from lioncash/renderer
renderer_base: Minor changes
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/gsp_gpu.cpp8
-rw-r--r--src/core/hle/service/y2r_u.cpp2
-rw-r--r--src/core/hw/gpu.cpp10
-rw-r--r--src/video_core/command_processor.cpp10
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp2
-rw-r--r--src/video_core/renderer_base.h18
6 files changed, 25 insertions, 25 deletions
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 5838b6d71..3d705821d 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -275,7 +275,7 @@ static void FlushDataCache(Service::Interface* self) {
275 u32 size = cmd_buff[2]; 275 u32 size = cmd_buff[2];
276 u32 process = cmd_buff[4]; 276 u32 process = cmd_buff[4];
277 277
278 VideoCore::g_renderer->rasterizer->InvalidateRegion(Memory::VirtualToPhysicalAddress(address), size); 278 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(Memory::VirtualToPhysicalAddress(address), size);
279 279
280 // TODO(purpasmart96): Verify return header on HW 280 // TODO(purpasmart96): Verify return header on HW
281 281
@@ -365,7 +365,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
365 365
366 // GX request DMA - typically used for copying memory from GSP heap to VRAM 366 // GX request DMA - typically used for copying memory from GSP heap to VRAM
367 case CommandId::REQUEST_DMA: 367 case CommandId::REQUEST_DMA:
368 VideoCore::g_renderer->rasterizer->FlushRegion(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), 368 VideoCore::g_renderer->Rasterizer()->FlushRegion(Memory::VirtualToPhysicalAddress(command.dma_request.source_address),
369 command.dma_request.size); 369 command.dma_request.size);
370 370
371 memcpy(Memory::GetPointer(command.dma_request.dest_address), 371 memcpy(Memory::GetPointer(command.dma_request.dest_address),
@@ -373,7 +373,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
373 command.dma_request.size); 373 command.dma_request.size);
374 SignalInterrupt(InterruptId::DMA); 374 SignalInterrupt(InterruptId::DMA);
375 375
376 VideoCore::g_renderer->rasterizer->InvalidateRegion(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), 376 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address),
377 command.dma_request.size); 377 command.dma_request.size);
378 break; 378 break;
379 379
@@ -467,7 +467,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
467 if (region.size == 0) 467 if (region.size == 0)
468 break; 468 break;
469 469
470 VideoCore::g_renderer->rasterizer->InvalidateRegion( 470 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(
471 Memory::VirtualToPhysicalAddress(region.address), region.size); 471 Memory::VirtualToPhysicalAddress(region.address), region.size);
472 } 472 }
473 break; 473 break;
diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp
index bbead9344..a495441a4 100644
--- a/src/core/hle/service/y2r_u.cpp
+++ b/src/core/hle/service/y2r_u.cpp
@@ -267,7 +267,7 @@ static void StartConversion(Service::Interface* self) {
267 // dst_image_size would seem to be perfect for this, but it doesn't include the gap :( 267 // dst_image_size would seem to be perfect for this, but it doesn't include the gap :(
268 u32 total_output_size = conversion.input_lines * 268 u32 total_output_size = conversion.input_lines *
269 (conversion.dst.transfer_unit + conversion.dst.gap); 269 (conversion.dst.transfer_unit + conversion.dst.gap);
270 VideoCore::g_renderer->rasterizer->InvalidateRegion( 270 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(
271 Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size); 271 Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size);
272 272
273 LOG_DEBUG(Service_Y2R, "called"); 273 LOG_DEBUG(Service_Y2R, "called");
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 5312baa83..7e2f9cdfa 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -140,7 +140,7 @@ inline void Write(u32 addr, const T data) {
140 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1); 140 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1);
141 } 141 }
142 142
143 VideoCore::g_renderer->rasterizer->InvalidateRegion(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress()); 143 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress());
144 } 144 }
145 145
146 // Reset "trigger" flag and set the "finish" flag 146 // Reset "trigger" flag and set the "finish" flag
@@ -171,7 +171,7 @@ inline void Write(u32 addr, const T data) {
171 u32 output_gap = config.texture_copy.output_gap * 16; 171 u32 output_gap = config.texture_copy.output_gap * 16;
172 172
173 size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); 173 size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap);
174 VideoCore::g_renderer->rasterizer->FlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size); 174 VideoCore::g_renderer->Rasterizer()->FlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size);
175 175
176 u32 remaining_size = config.texture_copy.size; 176 u32 remaining_size = config.texture_copy.size;
177 u32 remaining_input = input_width; 177 u32 remaining_input = input_width;
@@ -204,7 +204,7 @@ inline void Write(u32 addr, const T data) {
204 config.flags); 204 config.flags);
205 205
206 size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); 206 size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap);
207 VideoCore::g_renderer->rasterizer->InvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size); 207 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size);
208 208
209 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); 209 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF);
210 break; 210 break;
@@ -231,7 +231,7 @@ inline void Write(u32 addr, const T data) {
231 u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); 231 u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format);
232 u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); 232 u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format);
233 233
234 VideoCore::g_renderer->rasterizer->FlushRegion(config.GetPhysicalInputAddress(), input_size); 234 VideoCore::g_renderer->Rasterizer()->FlushRegion(config.GetPhysicalInputAddress(), input_size);
235 235
236 for (u32 y = 0; y < output_height; ++y) { 236 for (u32 y = 0; y < output_height; ++y) {
237 for (u32 x = 0; x < output_width; ++x) { 237 for (u32 x = 0; x < output_width; ++x) {
@@ -338,7 +338,7 @@ inline void Write(u32 addr, const T data) {
338 g_regs.display_transfer_config.trigger = 0; 338 g_regs.display_transfer_config.trigger = 0;
339 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); 339 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF);
340 340
341 VideoCore::g_renderer->rasterizer->InvalidateRegion(config.GetPhysicalOutputAddress(), output_size); 341 VideoCore::g_renderer->Rasterizer()->InvalidateRegion(config.GetPhysicalOutputAddress(), output_size);
342 } 342 }
343 break; 343 break;
344 } 344 }
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
61protected: 60protected:
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
65private: 65private:
66 bool opengl_rasterizer_active = false; 66 bool opengl_rasterizer_active = false;