From 699d56e35dc2944b6a224fed13e7f8941e89f8a9 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 16 Sep 2022 06:11:05 +0000 Subject: [PATCH] [d3d11] Handle nullptr RasterizerState in ApplyRasterizerSampleCount This broke as of a637134c56aea39ef031d9141224548df384269b is causing a crash in the BGFX d3d11 samples. --- src/d3d11/d3d11_context.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 26d8e5446..3c649c050 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -3227,7 +3227,9 @@ namespace dxvk { pc.rasterizerSampleCount = m_state.om.sampleCount; if (unlikely(!m_state.om.sampleCount)) { - pc.rasterizerSampleCount = m_state.rs.state->Desc()->ForcedSampleCount; + pc.rasterizerSampleCount = m_state.rs.state + ? m_state.rs.state->Desc()->ForcedSampleCount + : 0; if (!pc.rasterizerSampleCount) pc.rasterizerSampleCount = 1;