Make sure all resource states have at least one subresource state

* Even if it's invalid, this removes the need to check whether the data
  for a given id is empty or not.
This commit is contained in:
baldurk
2018-05-10 10:54:25 +01:00
parent 0233f39776
commit a8e807467d
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -1443,6 +1443,9 @@ void D3D12Replay::SavePipelineState()
for(size_t l = 0; l < it->second.size(); l++)
res.states[l].name = ToStr(it->second[l]);
if(res.states.empty())
res.states.push_back({"Unknown"});
i++;
}
}
+6
View File
@@ -1452,6 +1452,12 @@ void VulkanReplay::SavePipelineState()
img.layouts[l].numMip = it->second.subresourceStates[l].subresourceRange.levelCount;
}
if(img.layouts.empty())
{
img.layouts.push_back(VKPipe::ImageLayout());
img.layouts[0].name = "Unknown";
}
i++;
}
}