mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
VideoCommon: Change PokeEFB to take a pointer rather than a vector
This saves allocating a vector for the pass-through path.
This commit is contained in:
@ -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<EfbPokeData> 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<EfbPokeData>& 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<EfbPokeData>& data)
|
||||
FramebufferManager::GetEFBDepthTexture()->GetDSV());
|
||||
}
|
||||
|
||||
D3D::DrawEFBPokeQuads(type, data.data(), data.size());
|
||||
D3D::DrawEFBPokeQuads(type, points, num_points);
|
||||
|
||||
if (type == POKE_Z)
|
||||
{
|
||||
|
@ -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<EfbPokeData>& 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;
|
||||
|
@ -643,7 +643,7 @@ void FramebufferManager::GetTargetSize(unsigned int *width, unsigned int *height
|
||||
*height = m_targetHeight;
|
||||
}
|
||||
|
||||
void FramebufferManager::PokeEFB(EFBAccessType type, const std::vector<EfbPokeData>& 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::vector<EfbPokeDa
|
||||
|
||||
glBindVertexArray(m_EfbPokes_VAO);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_EfbPokes_VBO);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(EfbPokeData) * data.size(), data.data(), GL_STREAM_DRAW);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(EfbPokeData) * num_points, points, GL_STREAM_DRAW);
|
||||
m_EfbPokes.Bind();
|
||||
glViewport(0, 0, m_targetWidth, m_targetHeight);
|
||||
glDrawArrays(GL_POINTS, 0, (GLsizei)data.size());
|
||||
glDrawArrays(GL_POINTS, 0, (GLsizei)num_points);
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
|
||||
|
@ -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<EfbPokeData>& 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;
|
||||
|
@ -944,19 +944,6 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||
}
|
||||
}
|
||||
|
||||
case POKE_COLOR:
|
||||
case POKE_Z:
|
||||
{
|
||||
std::vector<EfbPokeData> 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<EfbPokeData>& 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)
|
||||
|
@ -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<EfbPokeData>& 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;
|
||||
|
Reference in New Issue
Block a user