From 2850c9a206fe69e569d3458f350045ca31a2ba97 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Tue, 16 Dec 2014 01:49:29 +0100 Subject: [PATCH] VertexManager: Disable culling for lines and points. --- Source/Core/VideoBackends/D3D/VertexManager.cpp | 4 ++++ Source/Core/VideoBackends/OGL/VertexManager.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Source/Core/VideoBackends/D3D/VertexManager.cpp b/Source/Core/VideoBackends/D3D/VertexManager.cpp index 9f2b2ba318..f51319bb73 100644 --- a/Source/Core/VideoBackends/D3D/VertexManager.cpp +++ b/Source/Core/VideoBackends/D3D/VertexManager.cpp @@ -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(); } } diff --git a/Source/Core/VideoBackends/OGL/VertexManager.cpp b/Source/Core/VideoBackends/OGL/VertexManager.cpp index d5ff396ba0..1a162b1cde 100644 --- a/Source/Core/VideoBackends/OGL/VertexManager.cpp +++ b/Source/Core/VideoBackends/OGL/VertexManager.cpp @@ -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)