1
0
Fork 0
forked from suyu/suyu

VideoCore: Rename HWRasterizer methods to be less confusing

This commit is contained in:
Yuri Kunde Schlesner 2015-12-06 17:56:45 -08:00
parent da80ece8b9
commit 03835d04f4
7 changed files with 22 additions and 22 deletions

View file

@ -275,7 +275,7 @@ static void FlushDataCache(Service::Interface* self) {
u32 size = cmd_buff[2]; u32 size = cmd_buff[2];
u32 process = cmd_buff[4]; u32 process = cmd_buff[4];
VideoCore::g_renderer->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(address), size); VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(Memory::VirtualToPhysicalAddress(address), size);
// TODO(purpasmart96): Verify return header on HW // TODO(purpasmart96): Verify return header on HW
@ -365,7 +365,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
// GX request DMA - typically used for copying memory from GSP heap to VRAM // GX request DMA - typically used for copying memory from GSP heap to VRAM
case CommandId::REQUEST_DMA: case CommandId::REQUEST_DMA:
VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), VideoCore::g_renderer->hw_rasterizer->FlushRegion(Memory::VirtualToPhysicalAddress(command.dma_request.source_address),
command.dma_request.size); command.dma_request.size);
memcpy(Memory::GetPointer(command.dma_request.dest_address), memcpy(Memory::GetPointer(command.dma_request.dest_address),
@ -373,7 +373,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
command.dma_request.size); command.dma_request.size);
SignalInterrupt(InterruptId::DMA); SignalInterrupt(InterruptId::DMA);
VideoCore::g_renderer->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address),
command.dma_request.size); command.dma_request.size);
break; break;
@ -467,7 +467,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
if (region.size == 0) if (region.size == 0)
break; break;
VideoCore::g_renderer->hw_rasterizer->NotifyFlush( VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(
Memory::VirtualToPhysicalAddress(region.address), region.size); Memory::VirtualToPhysicalAddress(region.address), region.size);
} }
break; break;

View file

@ -267,7 +267,7 @@ static void StartConversion(Service::Interface* self) {
// dst_image_size would seem to be perfect for this, but it doesn't include the gap :( // dst_image_size would seem to be perfect for this, but it doesn't include the gap :(
u32 total_output_size = conversion.input_lines * u32 total_output_size = conversion.input_lines *
(conversion.dst.transfer_unit + conversion.dst.gap); (conversion.dst.transfer_unit + conversion.dst.gap);
VideoCore::g_renderer->hw_rasterizer->NotifyFlush( VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(
Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size); Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size);
LOG_DEBUG(Service_Y2R, "called"); LOG_DEBUG(Service_Y2R, "called");

View file

@ -141,7 +141,7 @@ inline void Write(u32 addr, const T data) {
GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1); GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PSC1);
} }
VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress()); VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(config.GetStartAddress(), config.GetEndAddress() - config.GetStartAddress());
} }
// Reset "trigger" flag and set the "finish" flag // Reset "trigger" flag and set the "finish" flag
@ -172,7 +172,7 @@ inline void Write(u32 addr, const T data) {
u32 output_gap = config.texture_copy.output_gap * 16; u32 output_gap = config.texture_copy.output_gap * 16;
size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap);
VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(config.GetPhysicalInputAddress(), contiguous_input_size); VideoCore::g_renderer->hw_rasterizer->FlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size);
u32 remaining_size = config.texture_copy.size; u32 remaining_size = config.texture_copy.size;
u32 remaining_input = input_width; u32 remaining_input = input_width;
@ -205,7 +205,7 @@ inline void Write(u32 addr, const T data) {
config.flags); config.flags);
size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap);
VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetPhysicalOutputAddress(), contiguous_output_size); VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size);
GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF);
break; break;
@ -232,7 +232,7 @@ inline void Write(u32 addr, const T data) {
u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format); u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format);
u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format); u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format);
VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(config.GetPhysicalInputAddress(), input_size); VideoCore::g_renderer->hw_rasterizer->FlushRegion(config.GetPhysicalInputAddress(), input_size);
for (u32 y = 0; y < output_height; ++y) { for (u32 y = 0; y < output_height; ++y) {
for (u32 x = 0; x < output_width; ++x) { for (u32 x = 0; x < output_width; ++x) {
@ -339,7 +339,7 @@ inline void Write(u32 addr, const T data) {
g_regs.display_transfer_config.trigger = 0; g_regs.display_transfer_config.trigger = 0;
GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF); GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PPF);
VideoCore::g_renderer->hw_rasterizer->NotifyFlush(config.GetPhysicalOutputAddress(), output_size); VideoCore::g_renderer->hw_rasterizer->InvalidateRegion(config.GetPhysicalOutputAddress(), output_size);
} }
break; break;
} }

View file

@ -48,7 +48,7 @@ void DebugContext::OnEvent(Event event, void* data) {
if (Settings::values.use_hw_renderer) { if (Settings::values.use_hw_renderer) {
// Commit the hardware renderer's framebuffer so it will show on debug widgets // Commit the hardware renderer's framebuffer so it will show on debug widgets
VideoCore::g_renderer->hw_rasterizer->CommitFramebuffer(); VideoCore::g_renderer->hw_rasterizer->FlushFramebuffer();
} }
// TODO: Should stop the CPU thread here once we multithread emulation. // TODO: Should stop the CPU thread here once we multithread emulation.

View file

@ -32,14 +32,14 @@ public:
virtual void DrawTriangles() = 0; virtual void DrawTriangles() = 0;
/// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer
virtual void CommitFramebuffer() = 0; virtual void FlushFramebuffer() = 0;
/// Notify rasterizer that the specified PICA register has been changed /// Notify rasterizer that the specified PICA register has been changed
virtual void NotifyPicaRegisterChanged(u32 id) = 0; virtual void NotifyPicaRegisterChanged(u32 id) = 0;
/// Notify rasterizer that the specified 3DS memory region will be read from after this notification /// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory.
virtual void NotifyPreRead(PAddr addr, u32 size) = 0; virtual void FlushRegion(PAddr addr, u32 size) = 0;
/// Notify rasterizer that a 3DS memory region has been changed /// Notify rasterizer that any caches of the specified region should be discraded and reloaded from 3DS memory.
virtual void NotifyFlush(PAddr addr, u32 size) = 0; virtual void InvalidateRegion(PAddr addr, u32 size) = 0;
}; };

View file

@ -180,7 +180,7 @@ void RasterizerOpenGL::DrawTriangles() {
res_cache.InvalidateInRange(cur_fb_depth_addr, cur_fb_depth_size, true); res_cache.InvalidateInRange(cur_fb_depth_addr, cur_fb_depth_size, true);
} }
void RasterizerOpenGL::CommitFramebuffer() { void RasterizerOpenGL::FlushFramebuffer() {
CommitColorBuffer(); CommitColorBuffer();
CommitDepthBuffer(); CommitDepthBuffer();
} }
@ -284,7 +284,7 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
} }
} }
void RasterizerOpenGL::NotifyPreRead(PAddr addr, u32 size) { void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) {
const auto& regs = Pica::g_state.regs; const auto& regs = Pica::g_state.regs;
if (!Settings::values.use_hw_renderer) if (!Settings::values.use_hw_renderer)
@ -306,7 +306,7 @@ void RasterizerOpenGL::NotifyPreRead(PAddr addr, u32 size) {
CommitDepthBuffer(); CommitDepthBuffer();
} }
void RasterizerOpenGL::NotifyFlush(PAddr addr, u32 size) { void RasterizerOpenGL::InvalidateRegion(PAddr addr, u32 size) {
const auto& regs = Pica::g_state.regs; const auto& regs = Pica::g_state.regs;
if (!Settings::values.use_hw_renderer) if (!Settings::values.use_hw_renderer)

View file

@ -123,16 +123,16 @@ public:
void DrawTriangles() override; void DrawTriangles() override;
/// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer /// Commit the rasterizer's framebuffer contents immediately to the current 3DS memory framebuffer
void CommitFramebuffer() override; void FlushFramebuffer() override;
/// Notify rasterizer that the specified PICA register has been changed /// Notify rasterizer that the specified PICA register has been changed
void NotifyPicaRegisterChanged(u32 id) override; void NotifyPicaRegisterChanged(u32 id) override;
/// Notify rasterizer that the specified 3DS memory region will be read from after this notification /// Notify rasterizer that the specified 3DS memory region will be read from after this notification
void NotifyPreRead(PAddr addr, u32 size) override; void FlushRegion(PAddr addr, u32 size) override;
/// Notify rasterizer that a 3DS memory region has been changed /// Notify rasterizer that a 3DS memory region has been changed
void NotifyFlush(PAddr addr, u32 size) override; void InvalidateRegion(PAddr addr, u32 size) override;
/// OpenGL shader generated for a given Pica register state /// OpenGL shader generated for a given Pica register state
struct PicaShader { struct PicaShader {