From e67c0f2f6a62139c601af389f7e8db105580b016 Mon Sep 17 00:00:00 2001 From: bungeman Date: Tue, 14 Mar 2017 13:23:41 -0400 Subject: layers: Fix round tripping uint32_t through int Commit 25afc3c "Suppress VC++ 2017 signed/unsigned warning" fixed issue #1395. However, it did so by static_cast-ing a value back to a type it already had been. Instead, just avoid round tripping the 'uint32_t' through 'int'. --- layers/core_validation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 0dbafe76..17f0b201 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -8891,14 +8891,14 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer(VkDevice device, const VkFrameb return result; } -static bool FindDependency(const int index, const int dependent, const std::vector &subpass_to_node, +static bool FindDependency(const uint32_t index, const uint32_t 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; processed_nodes.insert(index); const DAGNode &node = subpass_to_node[index]; // Look for a dependency path. If one exists return true else recurse on the previous nodes. - if (std::find(node.prev.begin(), node.prev.end(), static_cast(dependent)) == node.prev.end()) { + if (std::find(node.prev.begin(), node.prev.end(), dependent) == node.prev.end()) { for (auto elem : node.prev) { if (FindDependency(elem, dependent, subpass_to_node, processed_nodes)) return true; } @@ -8908,7 +8908,8 @@ static bool FindDependency(const int index, const int dependent, const std::vect return false; } -static bool CheckDependencyExists(const layer_data *dev_data, const int subpass, const std::vector &dependent_subpasses, +static bool CheckDependencyExists(const layer_data *dev_data, const uint32_t subpass, + const std::vector &dependent_subpasses, const std::vector &subpass_to_node, bool &skip_call) { bool result = true; // Loop through all subpasses that share the same attachment and make sure a dependency exists -- cgit v1.2.3