From 7b59978c199c64bd8428cdae570f989002a7a2a4 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Fri, 7 Apr 2017 12:20:30 -0600 Subject: 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. --- layers/core_validation.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'layers/core_validation.cpp') 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(set), __LINE__, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS", - "Descriptor set 0x%" PRIxLEAST64 " encountered the following validation error at %s() time: %s", - reinterpret_cast(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(set), + __LINE__, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS", + "Descriptor set 0x%" PRIxLEAST64 " encountered the following validation error at %s time: %s", + reinterpret_cast(set), function, err_str.c_str()); } } } @@ -6207,6 +6208,10 @@ std::unordered_map *GetImageLayoutMap(l return &device_data->imageLayoutMap; } +std::unordered_map const *GetImageLayoutMap(layer_data const *device_data) { + return &device_data->imageLayoutMap; +} + std::unordered_map> *GetBufferMap(layer_data *device_data) { return &device_data->bufferMap; } -- cgit v1.2.3