Remove redundant/tautological checks

This commit is contained in:
baldurk
2020-02-13 11:01:45 +00:00
parent 9c091cf791
commit 69a82202e5
2 changed files with 13 additions and 18 deletions
+3 -5
View File
@@ -2274,8 +2274,7 @@ void ShaderViewer::updateDebugState()
lit("Resource"), ToQStr(roBind.resources[0].resourceId)});
node->setTag(QVariant::fromValue(
VariableTag(DebugVariableReference(DebugVariableType::ReadOnlyResource, ro.name))));
if(node)
ui->constants->addTopLevelItem(node);
ui->constants->addTopLevelItem(node);
}
else
{
@@ -2334,8 +2333,7 @@ void ShaderViewer::updateDebugState()
lit("Resource"), ToQStr(rwBind.resources[0].resourceId)});
node->setTag(QVariant::fromValue(
VariableTag(DebugVariableReference(DebugVariableType::ReadOnlyResource, rw.name))));
if(node)
ui->constants->addTopLevelItem(node);
ui->constants->addTopLevelItem(node);
}
else
{
@@ -3027,7 +3025,7 @@ void ShaderViewer::ToggleBreakpoint(int instruction)
if(instLine == -1)
{
if(m_Trace && instruction >= 0 && instruction < m_Trace->lineInfo.count())
if(m_Trace && instruction < m_Trace->lineInfo.count())
instLine = m_Trace->lineInfo[instruction].disassemblyLine - 1;
}
+10 -13
View File
@@ -1111,20 +1111,17 @@ void GatherConstantBuffers(WrappedID3D12Device *pDevice, const DXBCBytecode::Pro
bytebuf cbufData;
for(UINT n = 0; n < numDescriptors; ++n, ++slot.shaderRegister)
{
if(desc)
{
const D3D12_CONSTANT_BUFFER_VIEW_DESC &cbv = desc->GetCBV();
ResourceId resId;
uint64_t byteOffset = 0;
WrappedID3D12Resource1::GetResIDFromAddr(cbv.BufferLocation, resId, byteOffset);
ID3D12Resource *pCbvResource =
pDevice->GetResourceManager()->GetCurrentAs<ID3D12Resource>(resId);
cbufData.clear();
const D3D12_CONSTANT_BUFFER_VIEW_DESC &cbv = desc->GetCBV();
ResourceId resId;
uint64_t byteOffset = 0;
WrappedID3D12Resource1::GetResIDFromAddr(cbv.BufferLocation, resId, byteOffset);
ID3D12Resource *pCbvResource =
pDevice->GetResourceManager()->GetCurrentAs<ID3D12Resource>(resId);
cbufData.clear();
pDevice->GetDebugManager()->GetBufferData(pCbvResource, element.offset + byteOffset,
0, cbufData);
AddCBufferToGlobalState(program, global, sourceVars, refl, mapping, slot, cbufData);
}
pDevice->GetDebugManager()->GetBufferData(pCbvResource, element.offset + byteOffset, 0,
cbufData);
AddCBufferToGlobalState(program, global, sourceVars, refl, mapping, slot, cbufData);
desc++;
}