From 7c05b9a6d07d5c284497019524d6cf531a8e2f6d Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sat, 15 Nov 2014 01:53:08 +0100 Subject: [PATCH] D3D: Set the geometry shader for triangle primitives. --- Source/Core/VideoBackends/D3D/Render.cpp | 1 + Source/Core/VideoBackends/D3D/VertexManager.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index da9cbe6804..09355ca851 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -21,6 +21,7 @@ #include "VideoBackends/D3D/D3DState.h" #include "VideoBackends/D3D/D3DUtil.h" #include "VideoBackends/D3D/FramebufferManager.h" +#include "VideoBackends/D3D/GeometryShaderCache.h" #include "VideoBackends/D3D/PixelShaderCache.h" #include "VideoBackends/D3D/Render.h" #include "VideoBackends/D3D/Television.h" diff --git a/Source/Core/VideoBackends/D3D/VertexManager.cpp b/Source/Core/VideoBackends/D3D/VertexManager.cpp index 526cc30a0b..abc7f18e33 100644 --- a/Source/Core/VideoBackends/D3D/VertexManager.cpp +++ b/Source/Core/VideoBackends/D3D/VertexManager.cpp @@ -140,11 +140,15 @@ void VertexManager::Draw(u32 stride) if (current_primitive_type == PRIMITIVE_TRIANGLES) { D3D::stateman->SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + D3D::stateman->SetGeometryConstants(VertexShaderCache::GetConstantBuffer()); + D3D::stateman->SetGeometryShader(g_ActiveConfig.iStereoMode > 0 ? GeometryShaderCache::GetActiveShader() : nullptr); D3D::stateman->Apply(); D3D::context->DrawIndexed(indices, startIndex, baseVertex); INCSTAT(stats.thisFrame.numDrawCalls); + + D3D::stateman->SetGeometryShader(nullptr); } else if (current_primitive_type == PRIMITIVE_LINES) { @@ -220,6 +224,7 @@ void VertexManager::vFlush(bool useDstAlpha) if (!GeometryShaderCache::SetShader(components)) { GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR, true, { printf("Fail to set pixel shader\n"); }); + return; } }