GPU: Add option to disable PGXP on 2D polygons

This commit is contained in:
Stenzek
2024-07-09 20:30:30 +10:00
parent f0e2d1a9fa
commit de27e5de92
8 changed files with 89 additions and 26 deletions

View File

@ -2190,8 +2190,22 @@ void GPU_HW::LoadVertices()
if (!valid_w)
{
SetBatchDepthBuffer(false);
for (BatchVertex& v : vertices)
v.w = 1.0f;
if (g_settings.gpu_pgxp_disable_2d)
{
// NOTE: This reads uninitialized data, but it's okay, it doesn't get used.
for (size_t i = 0; i < vertices.size(); i++)
{
BatchVertex& v = vertices[i];
v.x = static_cast<float>(native_vertex_positions[i].x);
v.y = static_cast<float>(native_vertex_positions[i].y);
v.w = 1.0f;
}
}
else
{
for (BatchVertex& v : vertices)
v.w = 1.0f;
}
}
else if (m_pgxp_depth_buffer)
{