layers: Fix 32-bit compilation warnings/errors introduced last night.
authorMark Young <marky@lunarg.com>
Thu, 28 Jan 2016 16:36:15 +0000 (09:36 -0700)
committerMark Young <marky@lunarg.com>
Thu, 28 Jan 2016 16:36:15 +0000 (09:36 -0700)
Several 32-bit compilation warnings and errors were introduced into
draw_state.cpp last night.  This fixes those issues and allows our builds
to work again.

layers/draw_state.cpp

index 1bc59df1a9068fe57277001570818323bd1dec10..2e09412b3695cbbce2f69fe3f823f22be56bb34b 100644 (file)
@@ -3637,21 +3637,21 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice devi
     return result;
 }
 
-bool validateCommandBuffersNotInUse(const layer_data* dev_data, VkCommandPool commandPool) {
-    bool skip_call = false;
+VkBool32 validateCommandBuffersNotInUse(const layer_data* dev_data, VkCommandPool commandPool) {
+    VkBool32 skipCall = VK_FALSE;
     loader_platform_thread_lock_mutex(&globalLock);
     auto pool_data = dev_data->commandPoolMap.find(commandPool);
     if (pool_data != dev_data->commandPoolMap.end()) {
         for (auto cmdBuffer : pool_data->second.commandBuffers) {
             if (dev_data->inFlightCmdBuffers.count(cmdBuffer)) {
-                skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, reinterpret_cast<uint64_t>(commandPool),
-                                     __LINE__, DRAWSTATE_OBJECT_INUSE, "DS", "Cannot reset command pool %" PRIx64 " when allocated command buffer %" PRIx64 " is in use.",
-                                     reinterpret_cast<uint64_t>(commandPool), reinterpret_cast<uint64_t>(cmdBuffer));
+                skipCall |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, (uint64_t)(commandPool),
+                                    __LINE__, DRAWSTATE_OBJECT_INUSE, "DS", "Cannot reset command pool %" PRIx64 " when allocated command buffer %" PRIx64 " is in use.",
+                                    (uint64_t)(commandPool), (uint64_t)(cmdBuffer));
             }
         }
     }
     loader_platform_thread_unlock_mutex(&globalLock);
-    return skip_call;
+    return skipCall;
 }
 
 // Destroy commandPool along with all of the commandBuffers allocated from that pool
@@ -3673,7 +3673,7 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device,
 
     loader_platform_thread_unlock_mutex(&globalLock);
 
-    if (validateCommandBuffersNotInUse(dev_data, commandPool))
+    if (VK_TRUE == validateCommandBuffersNotInUse(dev_data, commandPool))
         return;
 
     dev_data->device_dispatch_table->DestroyCommandPool(device, commandPool, pAllocator);
@@ -3687,7 +3687,7 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(
     layer_data *dev_data               = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
     VkResult    result                = VK_ERROR_VALIDATION_FAILED_EXT;
 
-    if (validateCommandBuffersNotInUse(dev_data, commandPool))
+    if (VK_TRUE == validateCommandBuffersNotInUse(dev_data, commandPool))
         return VK_ERROR_VALIDATION_FAILED_EXT;
 
     result = dev_data->device_dispatch_table->ResetCommandPool(device, commandPool, flags);