mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Only set new dynamic states if pipeline uses them
This commit is contained in:
@@ -214,8 +214,12 @@ void D3D12RenderState::ApplyState(WrappedID3D12Device *dev, ID3D12GraphicsComman
|
||||
{
|
||||
D3D12_COMMAND_LIST_TYPE type = cmd->GetType();
|
||||
|
||||
ID3D12PipelineState *pipeState = NULL;
|
||||
if(pipe != ResourceId())
|
||||
cmd->SetPipelineState(GetResourceManager()->GetCurrentAs<ID3D12PipelineState>(pipe));
|
||||
{
|
||||
pipeState = GetResourceManager()->GetCurrentAs<ID3D12PipelineState>(pipe);
|
||||
cmd->SetPipelineState(pipeState);
|
||||
}
|
||||
|
||||
if(stateobj != ResourceId())
|
||||
cmd->SetPipelineState1(GetResourceManager()->GetCurrentAs<ID3D12StateObject>(stateobj));
|
||||
@@ -270,14 +274,17 @@ void D3D12RenderState::ApplyState(WrappedID3D12Device *dev, ID3D12GraphicsComman
|
||||
}
|
||||
}
|
||||
|
||||
if(GetWrapped(cmd)->GetReal9())
|
||||
if(GetWrapped(cmd)->GetReal9() && pipeState)
|
||||
{
|
||||
if(dev->GetOpts15().DynamicIndexBufferStripCutSupported)
|
||||
WrappedID3D12PipelineState *wrappedPipe = (WrappedID3D12PipelineState *)pipeState;
|
||||
if(dev->GetOpts15().DynamicIndexBufferStripCutSupported && wrappedPipe->IsGraphics() &&
|
||||
(wrappedPipe->graphics->Flags & D3D12_PIPELINE_STATE_FLAG_DYNAMIC_INDEX_BUFFER_STRIP_CUT))
|
||||
{
|
||||
cmd->IASetIndexBufferStripCutValue(cutValue);
|
||||
}
|
||||
|
||||
if(dev->GetOpts16().DynamicDepthBiasSupported)
|
||||
if(dev->GetOpts16().DynamicDepthBiasSupported && wrappedPipe->IsGraphics() &&
|
||||
(wrappedPipe->graphics->Flags & D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS))
|
||||
{
|
||||
cmd->RSSetDepthBias(depthBias, depthBiasClamp, slopeScaledDepthBias);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user