Add some safety checks of edge case problems

This commit is contained in:
baldurk
2020-02-12 11:33:01 +00:00
parent 56cfd25849
commit baa058a7e8
3 changed files with 6 additions and 2 deletions
@@ -120,6 +120,9 @@ bool D3D11DebugAPIWrapper::FetchSRV(const DXBCDebug::BindingSlot &slot)
ID3D11Resource *res = NULL;
pSRV->GetResource(&res);
if(!res)
return false;
D3D11_SHADER_RESOURCE_VIEW_DESC sdesc;
pSRV->GetDesc(&sdesc);
+2 -2
View File
@@ -342,7 +342,7 @@ void ImageSubresourceMap::Unsplit()
RDCASSERT(aspectCount * levelCount * layerCount * sliceCount == m_values.size());
#define UNSPLIT_INDEX(ASPECT, LEVEL, LAYER, SLICE) \
(((ASPECT * levelCount + LEVEL) * layerCount + LAYER) * sliceCount + SLICE)
((((ASPECT)*levelCount + (LEVEL)) * layerCount + (LAYER)) * sliceCount + (SLICE))
while(index < m_values.size() &&
(canUnsplitAspects || canUnsplitLevels || canUnsplitLayers || canUnsplitDepth))
{
@@ -765,7 +765,7 @@ template void BarrierSequence<VkImageMemoryBarrier>::Merge(
template <typename Barrier>
bool BarrierSequence<Barrier>::IsBatchEmpty(uint32_t batchIndex) const
{
if(batchIndex > MAX_BATCH_COUNT)
if(batchIndex >= MAX_BATCH_COUNT)
return true;
for(uint32_t queueFamilyIndex = 0; queueFamilyIndex < MAX_QUEUE_FAMILY_COUNT; ++queueFamilyIndex)
{
@@ -1543,6 +1543,7 @@ void CreateOcclusionPool(WrappedVulkan *vk, uint32_t poolSize, VkQueryPool *pQue
// TODO: check that occlusion feature is available
VkResult vkr =
ObjDisp(dev)->CreateQueryPool(Unwrap(dev), &occlusionPoolCreateInfo, NULL, pQueryPool);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
VkCommandBuffer cmd = vk->GetNextCmd();
VkCommandBufferBeginInfo beginInfo = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, NULL,
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};