From bfb4709c80fe07c1a072eb514f560a81a1a4b5f3 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 24 Feb 2018 23:13:00 +1000 Subject: [PATCH] AbstractPipeline: Allow setting pipeline to null --- Source/Core/VideoBackends/D3D/Render.cpp | 2 ++ Source/Core/VideoBackends/OGL/Render.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 79fa51a504..bce1ad674e 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -299,6 +299,8 @@ void Renderer::UpdateUtilityVertexBuffer(const void* vertices, u32 vertex_stride void Renderer::SetPipeline(const AbstractPipeline* pipeline) { const DXPipeline* dx_pipeline = static_cast(pipeline); + if (!dx_pipeline) + return; D3D::stateman->SetRasterizerState(dx_pipeline->GetRasterizerState()); D3D::stateman->SetDepthState(dx_pipeline->GetDepthState()); diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index e7c15782ec..ae9e45db99 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1622,6 +1622,9 @@ void Renderer::SetPipeline(const AbstractPipeline* pipeline) // Not all shader changes currently go through SetPipeline, so we can't // test if the pipeline hasn't changed and skip these applications. Yet. m_graphics_pipeline = static_cast(pipeline); + if (!m_graphics_pipeline) + return; + ApplyRasterizationState(m_graphics_pipeline->GetRasterizationState()); ApplyDepthState(m_graphics_pipeline->GetDepthState()); ApplyBlendingState(m_graphics_pipeline->GetBlendingState());