diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 434742c5c1..e7a04ea6ba 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -474,21 +474,11 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) else if (alpha_read_mode.ReadMode == 1) return (ret | 0xFF000000); // GX_READ_FF else /*if(alpha_read_mode.ReadMode == 0)*/ return (ret & 0x00FFFFFF); // GX_READ_00 } - else // if (type == POKE_COLOR || type == POKE_Z) - { - std::vector vector; - EfbPokeData d; - d.x = x; - d.y = y; - d.data = poke_data; - vector.push_back(d); - PokeEFB(type, vector); - } return 0; } -void Renderer::PokeEFB(EFBAccessType type, const std::vector& data) +void Renderer::PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) { ResetAPIState(); @@ -513,7 +503,7 @@ void Renderer::PokeEFB(EFBAccessType type, const std::vector& data) FramebufferManager::GetEFBDepthTexture()->GetDSV()); } - D3D::DrawEFBPokeQuads(type, data.data(), data.size()); + D3D::DrawEFBPokeQuads(type, points, num_points); if (type == POKE_Z) { diff --git a/Source/Core/VideoBackends/D3D/Render.h b/Source/Core/VideoBackends/D3D/Render.h index a6da457be8..8e25419a5a 100644 --- a/Source/Core/VideoBackends/D3D/Render.h +++ b/Source/Core/VideoBackends/D3D/Render.h @@ -37,7 +37,7 @@ public: void RenderText(const std::string& text, int left, int top, u32 color) override; u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override; - void PokeEFB(EFBAccessType type, const std::vector& data) override; + void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override; u16 BBoxRead(int index) override; void BBoxWrite(int index, u16 value) override; diff --git a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp index 6bde570d66..e826c031b0 100644 --- a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp +++ b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp @@ -643,7 +643,7 @@ void FramebufferManager::GetTargetSize(unsigned int *width, unsigned int *height *height = m_targetHeight; } -void FramebufferManager::PokeEFB(EFBAccessType type, const std::vector& data) +void FramebufferManager::PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) { g_renderer->ResetAPIState(); @@ -657,10 +657,10 @@ void FramebufferManager::PokeEFB(EFBAccessType type, const std::vectorRestoreAPIState(); diff --git a/Source/Core/VideoBackends/OGL/FramebufferManager.h b/Source/Core/VideoBackends/OGL/FramebufferManager.h index a1d2895562..24978990eb 100644 --- a/Source/Core/VideoBackends/OGL/FramebufferManager.h +++ b/Source/Core/VideoBackends/OGL/FramebufferManager.h @@ -92,7 +92,7 @@ public: // convtype=0 -> rgb8->rgba6, convtype=2 -> rgba6->rgb8 static void ReinterpretPixelData(unsigned int convtype); - static void PokeEFB(EFBAccessType type, const std::vector& data); + static void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points); private: XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) override; diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 4720925304..11e028c5c6 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -944,19 +944,6 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) } } - case POKE_COLOR: - case POKE_Z: - { - std::vector vector; - EfbPokeData d; - d.x = x; - d.y = y; - d.data = poke_data; - vector.push_back(d); - PokeEFB(type, vector); - break; - } - default: break; } @@ -964,9 +951,9 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) return 0; } -void Renderer::PokeEFB(EFBAccessType type, const std::vector& data) +void Renderer::PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) { - FramebufferManager::PokeEFB(type, data); + FramebufferManager::PokeEFB(type, points, num_points); } u16 Renderer::BBoxRead(int index) diff --git a/Source/Core/VideoBackends/OGL/Render.h b/Source/Core/VideoBackends/OGL/Render.h index b939911cee..3eb64663ab 100644 --- a/Source/Core/VideoBackends/OGL/Render.h +++ b/Source/Core/VideoBackends/OGL/Render.h @@ -87,7 +87,7 @@ public: void FlipImageData(u8 *data, int w, int h, int pixel_width = 3); u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override; - void PokeEFB(EFBAccessType type, const std::vector& data) override; + void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override; u16 BBoxRead(int index) override; void BBoxWrite(int index, u16 value) override; diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp index 993b6bce2c..1ce7c8fdb7 100644 --- a/Source/Core/VideoCommon/AsyncRequests.cpp +++ b/Source/Core/VideoCommon/AsyncRequests.cpp @@ -44,7 +44,7 @@ void AsyncRequests::PullEventsInternal() } while(!m_queue.empty() && m_queue.front().type == first_event.type); lock.unlock(); - g_renderer->PokeEFB(t, m_merged_efb_pokes); + g_renderer->PokeEFB(t, m_merged_efb_pokes.data(), m_merged_efb_pokes.size()); lock.lock(); continue; } @@ -109,11 +109,17 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e) switch (e.type) { case Event::EFB_POKE_COLOR: - g_renderer->AccessEFB(POKE_COLOR, e.efb_poke.x, e.efb_poke.y, e.efb_poke.data); + { + EfbPokeData poke = { e.efb_poke.x, e.efb_poke.y, e.efb_poke.data }; + g_renderer->PokeEFB(POKE_COLOR, &poke, 1); + } break; case Event::EFB_POKE_Z: - g_renderer->AccessEFB(POKE_Z, e.efb_poke.x, e.efb_poke.y, e.efb_poke.data); + { + EfbPokeData poke = { e.efb_poke.x, e.efb_poke.y, e.efb_poke.data }; + g_renderer->PokeEFB(POKE_Z, &poke, 1); + } break; case Event::EFB_PEEK_COLOR: diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 89bfa4dce1..3742145ebc 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -617,10 +617,3 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const XFBWrited = false; } -void Renderer::PokeEFB(EFBAccessType type, const std::vector& data) -{ - for (EfbPokeData poke : data) - { - AccessEFB(type, poke.x, poke.y, poke.data); - } -} diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index ad53f2f20c..773fb45ee5 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -115,7 +115,7 @@ public: static void RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbStride, u32 fbHeight, float Gamma = 1.0f); virtual u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) = 0; - virtual void PokeEFB(EFBAccessType type, const std::vector& data); + virtual void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) = 0; virtual u16 BBoxRead(int index) = 0; virtual void BBoxWrite(int index, u16 value) = 0;