diff options
| author | 2015-12-06 17:56:45 -0800 | |
|---|---|---|
| committer | 2015-12-06 19:08:37 -0800 | |
| commit | 03835d04f42fdcd480b5f5d909b5e5cd81ed62a0 (patch) | |
| tree | 6e14cebd99073538bfafdd68d2bc5b41ff38b698 /src | |
| parent | OpenGL: Rename cache functions to better match what they actually do (diff) | |
| download | yuzu-03835d04f42fdcd480b5f5d909b5e5cd81ed62a0.tar.gz yuzu-03835d04f42fdcd480b5f5d909b5e5cd81ed62a0.tar.xz yuzu-03835d04f42fdcd480b5f5d909b5e5cd81ed62a0.zip | |
VideoCore: Rename HWRasterizer methods to be less confusing
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/gsp_gpu.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/y2r_u.cpp | 2 | ||||
| -rw-r--r-- | src/core/hw/gpu.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/hwrasterizer_base.h | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 6 |
7 files changed, 22 insertions, 22 deletions
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index 481da0c9f..3e4c70e18 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->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(address), size); | 278 | VideoCore::g_renderer->hw_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->hw_rasterizer->NotifyPreRead(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), | 368 | VideoCore::g_renderer->hw_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->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), | 376 | VideoCore::g_renderer->hw_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->hw_rasterizer->NotifyFlush( | 470 | VideoCore::g_renderer->hw_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 6b1b71fe4..face1d7b0 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->hw_rasterizer->NotifyFlush( | 270 | VideoCore::g_renderer->hw_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 bc7bde903..55e215600 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp | |||
| @@ -141,7 +141,7 @@ inline void Write(u32 addr, const T data) { | |||
| 141 | GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1); | 141 | GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress()); | 144 | VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress()); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | // Reset "trigger" flag and set the "finish" flag | 147 | // Reset "trigger" flag and set the "finish" flag |
| @@ -172,7 +172,7 @@ inline void Write(u32 addr, const T data) { | |||
| 172 | u32 output_gap = config.texture_copy.output_gap * 16; | 172 | u32 output_gap = config.texture_copy.output_gap * 16; |
| 173 | 173 | ||
| 174 | size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); | 174 | size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); |
| 175 | VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(config.GetPhysicalInputAddress(), contiguous_input_size); | 175 | VideoCore::g_renderer->hw_rasterizer->FlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size); |
| 176 | 176 | ||
| 177 | u32 remaining_size = config.texture_copy.size; | 177 | u32 remaining_size = config.texture_copy.size; |
| 178 | u32 remaining_input = input_width; | 178 | u32 remaining_input = input_width; |
| @@ -205,7 +205,7 @@ inline void Write(u32 addr, const T data) { | |||
| 205 | config.flags); | 205 | config.flags); |
| 206 | 206 | ||
| 207 | size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); | 207 | size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); |
| 208 | VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetPhysicalOutputAddress(), contiguous_output_size); | 208 | VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size); |
| 209 | 209 | ||
| 210 | GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); | 210 | GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); |
| 211 | break; | 211 | break; |
| @@ -232,7 +232,7 @@ inline void Write(u32 addr, const T data) { | |||
| 232 | u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); | 232 | u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); |
| 233 | u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); | 233 | u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); |
| 234 | 234 | ||
| 235 | VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(config.GetPhysicalInputAddress(), input_size); | 235 | VideoCore::g_renderer->hw_rasterizer->FlushRegion(config.GetPhysicalInputAddress(), input_size); |
| 236 | 236 | ||
| 237 | for (u32 y = 0; y < output_height; ++y) { | 237 | for (u32 y = 0; y < output_height; ++y) { |
| 238 | for (u32 x = 0; x < output_width; ++x) { | 238 | for (u32 x = 0; x < output_width; ++x) { |
| @@ -339,7 +339,7 @@ inline void Write(u32 addr, const T data) { | |||
| 339 | g_regs.display_transfer_config.trigger = 0; | 339 | g_regs.display_transfer_config.trigger = 0; |
| 340 | GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); | 340 | GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); |
| 341 | 341 | ||
| 342 | VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetPhysicalOutputAddress(), output_size); | 342 | VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(config.GetPhysicalOutputAddress(), output_size); |
| 343 | } | 343 | } |
| 344 | break; | 344 | break; |
| 345 | } | 345 | } |
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index f1cfa9361..0e29661c7 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 | 48 | ||
| 49 | if (Settings::values.use_hw_renderer) { | 49 | if (Settings::values.use_hw_renderer) { |
| 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->hw_rasterizer->CommitFramebuffer(); | 51 | VideoCore::g_renderer->hw_rasterizer->FlushFramebuffer(); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | // TODO: Should stop the CPU thread here once we multithread emulation. | 54 | // TODO: Should stop the CPU thread here once we multithread emulation. |
diff --git a/src/video_core/hwrasterizer_base.h b/src/video_core/hwrasterizer_base.h index 54b8892fb..b6390950a 100644 --- a/src/video_core/hwrasterizer_base.h +++ b/src/video_core/hwrasterizer_base.h | |||
| @@ -32,14 +32,14 @@ public: | |||
| 32 | virtual void DrawTriangles() = 0; | 32 | virtual void DrawTriangles() = 0; |
| 33 | 33 | ||
| 34 | /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer | 34 | /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer |
| 35 | virtual void CommitFramebuffer() = 0; | 35 | virtual void FlushFramebuffer() = 0; |
| 36 | 36 | ||
| 37 | /// Notify rasterizer that the specified PICA register has been changed | 37 | /// Notify rasterizer that the specified PICA register has been changed |
| 38 | virtual void NotifyPicaRegisterChanged(u32 id) = 0; | 38 | virtual void NotifyPicaRegisterChanged(u32 id) = 0; |
| 39 | 39 | ||
| 40 | /// Notify rasterizer that the specified 3DS memory region will be read from after this notification | 40 | /// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory. |
| 41 | virtual void NotifyPreRead(PAddr addr, u32 size) = 0; | 41 | virtual void FlushRegion(PAddr addr, u32 size) = 0; |
| 42 | 42 | ||
| 43 | /// Notify rasterizer that a 3DS memory region has been changed | 43 | /// Notify rasterizer that any caches of the specified region should be discraded and reloaded from 3DS memory. |
| 44 | virtual void NotifyFlush(PAddr addr, u32 size) = 0; | 44 | virtual void InvalidateRegion(PAddr addr, u32 size) = 0; |
| 45 | }; | 45 | }; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index ca8247b86..cc7830688 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -180,7 +180,7 @@ void RasterizerOpenGL::DrawTriangles() { | |||
| 180 | res_cache.InvalidateInRange(cur_fb_depth_addr, cur_fb_depth_size, true); | 180 | res_cache.InvalidateInRange(cur_fb_depth_addr, cur_fb_depth_size, true); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | void RasterizerOpenGL::CommitFramebuffer() { | 183 | void RasterizerOpenGL::FlushFramebuffer() { |
| 184 | CommitColorBuffer(); | 184 | CommitColorBuffer(); |
| 185 | CommitDepthBuffer(); | 185 | CommitDepthBuffer(); |
| 186 | } | 186 | } |
| @@ -284,7 +284,7 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) { | |||
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | void RasterizerOpenGL::NotifyPreRead(PAddr addr, u32 size) { | 287 | void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) { |
| 288 | const auto& regs = Pica::g_state.regs; | 288 | const auto& regs = Pica::g_state.regs; |
| 289 | 289 | ||
| 290 | if (!Settings::values.use_hw_renderer) | 290 | if (!Settings::values.use_hw_renderer) |
| @@ -306,7 +306,7 @@ void RasterizerOpenGL::NotifyPreRead(PAddr addr, u32 size) { | |||
| 306 | CommitDepthBuffer(); | 306 | CommitDepthBuffer(); |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | void RasterizerOpenGL::NotifyFlush(PAddr addr, u32 size) { | 309 | void RasterizerOpenGL::InvalidateRegion(PAddr addr, u32 size) { |
| 310 | const auto& regs = Pica::g_state.regs; | 310 | const auto& regs = Pica::g_state.regs; |
| 311 | 311 | ||
| 312 | if (!Settings::values.use_hw_renderer) | 312 | if (!Settings::values.use_hw_renderer) |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 5ba898189..378cdb65c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -123,16 +123,16 @@ public: | |||
| 123 | void DrawTriangles() override; | 123 | void DrawTriangles() override; |
| 124 | 124 | ||
| 125 | /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer | 125 | /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer |
| 126 | void CommitFramebuffer() override; | 126 | void FlushFramebuffer() override; |
| 127 | 127 | ||
| 128 | /// Notify rasterizer that the specified PICA register has been changed | 128 | /// Notify rasterizer that the specified PICA register has been changed |
| 129 | void NotifyPicaRegisterChanged(u32 id) override; | 129 | void NotifyPicaRegisterChanged(u32 id) override; |
| 130 | 130 | ||
| 131 | /// Notify rasterizer that the specified 3DS memory region will be read from after this notification | 131 | /// Notify rasterizer that the specified 3DS memory region will be read from after this notification |
| 132 | void NotifyPreRead(PAddr addr, u32 size) override; | 132 | void FlushRegion(PAddr addr, u32 size) override; |
| 133 | 133 | ||
| 134 | /// Notify rasterizer that a 3DS memory region has been changed | 134 | /// Notify rasterizer that a 3DS memory region has been changed |
| 135 | void NotifyFlush(PAddr addr, u32 size) override; | 135 | void InvalidateRegion(PAddr addr, u32 size) override; |
| 136 | 136 | ||
| 137 | /// OpenGL shader generated for a given Pica register state | 137 | /// OpenGL shader generated for a given Pica register state |
| 138 | struct PicaShader { | 138 | struct PicaShader { |