aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-04-07 12:20:30 -0600
committerTobin Ehlis <tobine@google.com>2017-04-14 15:46:26 -0600
commit7b59978c199c64bd8428cdae570f989002a7a2a4 (patch)
tree73feaf1c10ead0280011020d5c81dc88357297e1 /layers/core_validation.cpp
parent32cd102c36c6fca2679904aa9e59fdffc64ded59 (diff)
downloadusermoji-7b59978c199c64bd8428cdae570f989002a7a2a4.tar.xz
layers:Add image layout validation for descriptors
This change adds validation to make sure that an image layout at the time the image is used in a descriptor matches the layout that was given when the descriptor was updated. Because image view covers a range of mip levels, loop over each level and verify layouts one at a time. Also Updated a number of validate functions to use cont ptr params for data that they aren't changing.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index ded7b803..b12e5d42 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3022,13 +3022,14 @@ static bool ValidateDrawState(layer_data *dev_data, GLOBAL_CB_NODE *cb_node, con
}
// Validate the draw-time state for this descriptor set
std::string err_str;
- if (!descriptor_set->ValidateDrawState(set_binding_pair.second, state.dynamicOffsets[setIndex], &err_str)) {
+ if (!descriptor_set->ValidateDrawState(set_binding_pair.second, state.dynamicOffsets[setIndex], cb_node, function,
+ &err_str)) {
auto set = descriptor_set->GetSet();
- result |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- reinterpret_cast<const uint64_t &>(set), __LINE__, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS",
- "Descriptor set 0x%" PRIxLEAST64 " encountered the following validation error at %s() time: %s",
- reinterpret_cast<const uint64_t &>(set), function, err_str.c_str());
+ result |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, reinterpret_cast<const uint64_t &>(set),
+ __LINE__, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS",
+ "Descriptor set 0x%" PRIxLEAST64 " encountered the following validation error at %s time: %s",
+ reinterpret_cast<const uint64_t &>(set), function, err_str.c_str());
}
}
}
@@ -6207,6 +6208,10 @@ std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> *GetImageLayoutMap(l
return &device_data->imageLayoutMap;
}
+std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> const *GetImageLayoutMap(layer_data const *device_data) {
+ return &device_data->imageLayoutMap;
+}
+
std::unordered_map<VkBuffer, std::unique_ptr<BUFFER_STATE>> *GetBufferMap(layer_data *device_data) {
return &device_data->bufferMap;
}