Unset pipeline state values if shaders/pipelines are not bound

* Since we're updating a single member struct in-place and not starting
  from a clean slate, we need to be sure to unset state values instead
  of just skipping them and assuming the default is empty.
This commit is contained in:
baldurk
2018-02-20 13:33:23 +00:00
parent 13c1cf6ad4
commit db1cc10598
4 changed files with 577 additions and 532 deletions
+4
View File
@@ -650,6 +650,10 @@ void D3D11Replay::SavePipelineState()
refl = &shad->GetDetails();
dst.bindpointMapping = shad->GetMapping();
}
else
{
dst.bindpointMapping = ShaderBindpointMapping();
}
dst.resourceId = rm->GetOriginalID(id);
dst.reflection = refl;
+17 -3
View File
@@ -623,6 +623,8 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root
WrappedID3D12RootSignature *sig =
m_pDevice->GetResourceManager()->GetCurrentAs<WrappedID3D12RootSignature>(rootSig.rootsig);
// clear first to ensure the spaces are default-initialised
dstSpaces.clear();
dstSpaces.resize(sig->sig.numSpaces);
D3D12Pipe::RegisterSpace *spaces = dstSpaces.data();
@@ -938,7 +940,7 @@ void D3D12Replay::SavePipelineState()
{
const D3D12RenderState &rs = m_pDevice->GetQueue()->GetCommandData()->m_RenderState;
D3D12Pipe::State state;
D3D12Pipe::State &state = m_PipelineState;
/////////////////////////////////////////////////
// Input Assembler
@@ -1045,6 +1047,12 @@ void D3D12Replay::SavePipelineState()
dst.bindpointMapping = sh->GetMapping();
dst.reflection = &sh->GetDetails();
}
else
{
dst.resourceId = ResourceId();
dst.bindpointMapping = ShaderBindpointMapping();
dst.reflection = NULL;
}
if(rs.graphics.rootsig != ResourceId())
FillRegisterSpaces(rs.graphics, dst.spaces, visibility[stage]);
@@ -1137,6 +1145,10 @@ void D3D12Replay::SavePipelineState()
FillResourceView(view, desc);
}
else
{
view = D3D12Pipe::View();
}
}
{
@@ -1151,6 +1163,10 @@ void D3D12Replay::SavePipelineState()
FillResourceView(view, desc);
}
else
{
view = D3D12Pipe::View();
}
}
memcpy(state.outputMerger.blendState.blendFactor, rs.blendFactor, sizeof(FLOAT) * 4);
@@ -1239,8 +1255,6 @@ void D3D12Replay::SavePipelineState()
i++;
}
}
m_PipelineState = state;
}
void D3D12Replay::RenderHighlightBox(float w, float h, float scale)
+3 -3
View File
@@ -852,9 +852,7 @@ void GLReplay::SavePipelineState()
{
stages[i]->programResourceId = stages[i]->shaderResourceId = ResourceId();
stages[i]->reflection = NULL;
stages[i]->bindpointMapping.constantBlocks.clear();
stages[i]->bindpointMapping.readOnlyResources.clear();
stages[i]->bindpointMapping.readWriteResources.clear();
stages[i]->bindpointMapping = ShaderBindpointMapping();
}
if(curProg == 0)
@@ -937,6 +935,8 @@ void GLReplay::SavePipelineState()
if(feedback != 0)
pipe.transformFeedback.feedbackResourceId =
rm->GetOriginalID(rm->GetID(FeedbackRes(ctx, feedback)));
else
pipe.transformFeedback.feedbackResourceId = ResourceId();
GLint maxCount = 0;
gl.glGetIntegerv(eGL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxCount);
File diff suppressed because it is too large Load Diff