mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add some safety checks of edge case problems
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user