aboutsummaryrefslogtreecommitdiff
path: root/layers/object_tracker.cpp
diff options
context:
space:
mode:
authorTony Barbour <tony@LunarG.com>2017-02-02 09:31:30 -0700
committerTony Barbour <tony@LunarG.com>2017-02-03 15:51:29 -0700
commitab8789dd8423fb491b59985025ad552d4e7c5d8f (patch)
tree88fb6e88624b9078b1ef4d707adae1990c30ebc4 /layers/object_tracker.cpp
parente8c5817289db5d3bb5e3e9e0b08fb06feb611b09 (diff)
downloadusermoji-ab8789dd8423fb491b59985025ad552d4e7c5d8f.tar.xz
layers: Tolerate null handles in destroy and free routines
Several CTS tests call destroy routines with null pointers. This keeps validation layers from crashing or reporting false positives Change-Id: I95a3bee21902598dffc0df28e53f5ff253cb6207
Diffstat (limited to 'layers/object_tracker.cpp')
-rw-r--r--layers/object_tracker.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/layers/object_tracker.cpp b/layers/object_tracker.cpp
index f4acbe36..41811e94 100644
--- a/layers/object_tracker.cpp
+++ b/layers/object_tracker.cpp
@@ -3475,7 +3475,9 @@ VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(VkDevice device, VkCommandPool com
ValidateObject(device, commandPool, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, false, VALIDATION_ERROR_00099);
ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_00098);
for (uint32_t i = 0; i < commandBufferCount; i++) {
- skip_call |= ValidateCommandBuffer(device, commandPool, pCommandBuffers[i]);
+ if (pCommandBuffers[i] != VK_NULL_HANDLE) {
+ skip_call |= ValidateCommandBuffer(device, commandPool, pCommandBuffers[i]);
+ }
}
for (uint32_t i = 0; i < commandBufferCount; i++) {
@@ -3521,7 +3523,9 @@ VKAPI_ATTR VkResult VKAPI_CALL FreeDescriptorSets(VkDevice device, VkDescriptorP
ValidateObject(device, descriptorPool, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, false, VALIDATION_ERROR_00924);
skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_00923);
for (uint32_t i = 0; i < descriptorSetCount; i++) {
- skip_call |= ValidateDescriptorSet(device, descriptorPool, pDescriptorSets[i]);
+ if (pDescriptorSets[i] != VK_NULL_HANDLE) {
+ skip_call |= ValidateDescriptorSet(device, descriptorPool, pDescriptorSets[i]);
+ }
}
for (uint32_t i = 0; i < descriptorSetCount; i++) {