From 775031c59b71c6dac4dad523069b506b5a9d237b Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 25 Jan 2024 12:29:14 +0000 Subject: [PATCH] Limit impact of possible NV driver bug * This seems to crash if no pipeline is bound when SetViewInstanceMask() is called. We can't make this completely conditional and still be legal, but at least we can avoid triggering it if view instancing isn't being used anyway. --- renderdoc/driver/d3d12/d3d12_state.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/d3d12/d3d12_state.cpp b/renderdoc/driver/d3d12/d3d12_state.cpp index e455e527a7..6bf1884c1d 100644 --- a/renderdoc/driver/d3d12/d3d12_state.cpp +++ b/renderdoc/driver/d3d12/d3d12_state.cpp @@ -245,7 +245,8 @@ void D3D12RenderState::ApplyState(WrappedID3D12Device *dev, ID3D12GraphicsComman } // safe to set this - if the pipeline has view instancing disabled, it will do nothing - if(dev->GetOpts3().ViewInstancingTier != D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED) + if(dev->GetOpts3().ViewInstancingTier != D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED && + viewInstMask != 0) cmd->SetViewInstanceMask(viewInstMask); }