VertexManager: Disable culling for lines and points.

This commit is contained in:
Jules Blok 2014-12-16 01:49:29 +01:00
parent 0ac7103391
commit 2850c9a206
2 changed files with 9 additions and 0 deletions

View File

@ -141,6 +141,7 @@ void VertexManager::Draw(u32 stride)
}
else if (current_primitive_type == PRIMITIVE_LINES)
{
((DX11::Renderer*)g_renderer)->ApplyCullDisable();
D3D::stateman->SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINELIST);
D3D::stateman->SetGeometryConstants(GeometryShaderCache::GetConstantBuffer());
D3D::stateman->SetGeometryShader(GeometryShaderCache::GetActiveShader());
@ -151,9 +152,11 @@ void VertexManager::Draw(u32 stride)
INCSTAT(stats.thisFrame.numDrawCalls);
D3D::stateman->SetGeometryShader(nullptr);
((DX11::Renderer*)g_renderer)->RestoreCull();
}
else //if (current_primitive_type == PRIMITIVE_POINTS)
{
((DX11::Renderer*)g_renderer)->ApplyCullDisable();
D3D::stateman->SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
D3D::stateman->SetGeometryConstants(GeometryShaderCache::GetConstantBuffer());
D3D::stateman->SetGeometryShader(GeometryShaderCache::GetActiveShader());
@ -164,6 +167,7 @@ void VertexManager::Draw(u32 stride)
INCSTAT(stats.thisFrame.numDrawCalls);
D3D::stateman->SetGeometryShader(nullptr);
((DX11::Renderer*)g_renderer)->RestoreCull();
}
}

View File

@ -101,9 +101,11 @@ void VertexManager::Draw(u32 stride)
{
case PRIMITIVE_POINTS:
primitive_mode = GL_POINTS;
glDisable(GL_CULL_FACE);
break;
case PRIMITIVE_LINES:
primitive_mode = GL_LINES;
glDisable(GL_CULL_FACE);
break;
case PRIMITIVE_TRIANGLES:
primitive_mode = g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? GL_TRIANGLE_STRIP : GL_TRIANGLES;
@ -120,6 +122,9 @@ void VertexManager::Draw(u32 stride)
}
INCSTAT(stats.thisFrame.numDrawCalls);
if (current_primitive_type != PRIMITIVE_TRIANGLES)
((OGL::Renderer*)g_renderer)->SetGenerationMode();
}
void VertexManager::vFlush(bool useDstAlpha)