aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorbungeman <bungeman@chromium.org>2017-03-14 13:23:41 -0400
committerMark Lobodzinski <mark@lunarg.com>2017-03-14 15:11:18 -0600
commite67c0f2f6a62139c601af389f7e8db105580b016 (patch)
treed52b401aad1f9e696a62ff026316357e35d773f2 /layers/core_validation.cpp
parentbc3d4f37e0753ae8efb311b17d9e3497d3a8a703 (diff)
downloadusermoji-e67c0f2f6a62139c601af389f7e8db105580b016.tar.xz
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'.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp7
1 files changed, 4 insertions, 3 deletions
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<DAGNode> &subpass_to_node,
+static bool FindDependency(const uint32_t index, const uint32_t dependent, const std::vector<DAGNode> &subpass_to_node,
std::unordered_set<uint32_t> &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<uint32_t>(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<uint32_t> &dependent_subpasses,
+static bool CheckDependencyExists(const layer_data *dev_data, const uint32_t subpass,
+ const std::vector<uint32_t> &dependent_subpasses,
const std::vector<DAGNode> &subpass_to_node, bool &skip_call) {
bool result = true;
// Loop through all subpasses that share the same attachment and make sure a dependency exists