From 5c04ee24cca678e37c2fd08ca74281d01466eba8 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Tue, 3 Nov 2015 15:41:43 -0700 Subject: [PATCH] misc: Cleanup Windows compiler warnings --- layers/draw_state.cpp | 24 ++++++++++++------------ layers/draw_state.h | 2 +- layers/shader_checker.cpp | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index c50a23a..3de7e14 100755 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -52,7 +52,7 @@ #include "vk_layer_utils.h" struct devExts { - bool debug_marker_enabled; + VkBool32 debug_marker_enabled; }; struct layer_data { @@ -868,7 +868,7 @@ static VkBool32 validateImageView(const layer_data* my_data, const VkImageView* "vkUpdateDescriptorSets: Attempt to update descriptor with invalid image handle %#" PRIxLEAST64 " in imageView %#" PRIxLEAST64, (uint64_t) image, (uint64_t) *pImageView); } else { VkFormat format = (*imgIt).second->format; - bool ds = vk_format_is_depth_or_stencil(format); + VkBool32 ds = vk_format_is_depth_or_stencil(format); switch (imageLayout) { case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: // Only Color bit must be set @@ -3292,7 +3292,7 @@ struct DAGNode { std::vector next; }; -bool FindDependency(const int index, const int dependent, const std::vector& subpass_to_node, std::unordered_set& processed_nodes) { +VkBool32 FindDependency(const int index, const int dependent, const std::vector& subpass_to_node, std::unordered_set& processed_nodes) { // If we have already checked this node we have not found a dependency path so return false. if (processed_nodes.count(index)) return false; @@ -3310,8 +3310,8 @@ bool FindDependency(const int index, const int dependent, const std::vector& dependent_subpasses, const std::vector& subpass_to_node, bool& skip_call) { - bool result = true; +VkBool32 CheckDependencyExists(const layer_data* my_data, VkDevice device, const int subpass, const std::vector& dependent_subpasses, const std::vector& subpass_to_node, VkBool32& skip_call) { + VkBool32 result = true; // Loop through all subpasses that share the same attachment and make sure a dependency exists for (uint32_t k = 0; k < dependent_subpasses.size(); ++k) { if (subpass == dependent_subpasses[k]) @@ -3339,20 +3339,20 @@ bool CheckDependencyExists(const layer_data* my_data, VkDevice device, const int return result; } -bool CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const int index, const int attachment, const std::vector& subpass_to_node, int depth, bool& skip_call) { +VkBool32 CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const int index, const int attachment, const std::vector& subpass_to_node, int depth, VkBool32& skip_call) { const DAGNode& node = subpass_to_node[index]; // If this node writes to the attachment return true as next nodes need to preserve the attachment. const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[index]; for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) { if (attachment == subpass.pColorAttachments[j].attachment) - return true; + return VK_TRUE; } if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { if (attachment == subpass.pDepthStencilAttachment->attachment) - return true; + return VK_TRUE; } - bool result = false; + VkBool32 result = VK_FALSE; // Loop through previous nodes and see if any of them write to the attachment. for (auto elem : node.prev) { result |= CheckPreserved(my_data, device, pCreateInfo, elem, attachment, subpass_to_node, depth + 1, skip_call); @@ -3360,7 +3360,7 @@ bool CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPa // If the attachment was written to by a previous node than this node needs to preserve it. if (result && depth > 0) { const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[index]; - bool has_preserved = false; + VkBool32 has_preserved = false; for (uint32_t j = 0; j < subpass.preserveAttachmentCount; ++j) { if (subpass.pPreserveAttachments[j].attachment == attachment) { has_preserved = true; @@ -3375,8 +3375,8 @@ bool CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPa return result; } -bool validateDependencies(const layer_data* my_data, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo) { - bool skip_call = false; +VkBool32 validateDependencies(const layer_data* my_data, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo) { + VkBool32 skip_call = false; std::vector subpass_to_node(pCreateInfo->subpassCount); std::vector> output_attachment_to_subpass(pCreateInfo->attachmentCount); std::vector> input_attachment_to_subpass(pCreateInfo->attachmentCount); diff --git a/layers/draw_state.h b/layers/draw_state.h index 83b494b..e8678dd 100755 --- a/layers/draw_state.h +++ b/layers/draw_state.h @@ -185,7 +185,7 @@ typedef struct _POOL_NODE { createInfo.pPoolSizes = new VkDescriptorPoolSize[poolSizeCountSize]; memcpy((void*)createInfo.pPoolSizes, pCreateInfo->pPoolSizes, poolSizeCountSize); // Now set max counts for each descriptor type based on count of that type times maxSets - int32_t i=0; + uint32_t i=0; for (i=0; i(createInfo.pPoolSizes[i].type); uint32_t poolSizeCount = createInfo.pPoolSizes[i].descriptorCount; diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp index 2b078b7..715fb11 100644 --- a/layers/shader_checker.cpp +++ b/layers/shader_checker.cpp @@ -291,7 +291,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateDeviceExtensionProperties( if (pLayerName == NULL) { dispatch_key key = get_dispatch_key(physicalDevice); layer_data *my_data = get_my_data_ptr(key, layer_data_map); - my_data->instance_dispatch_table->EnumerateDeviceExtensionProperties( + return my_data->instance_dispatch_table->EnumerateDeviceExtensionProperties( physicalDevice, NULL, pCount, -- 2.7.4