layer: Add in-use validation for imageView
Bind imageView from a descriptor to the command buffer at CmdBindDescriptorSets
time and check for an in-use imageView at DestroyImageView time.
Also use new AddCommandBufferBindingImageView() helper to bind children of
framebuffer in AddFrameBufferBinding().
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index df5dac2..f02da6b 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -880,9 +880,7 @@
// Add binding for image
auto iv_state = getImageViewState(dev_data, image_view_);
if (iv_state) {
- auto image_node = getImageNode(dev_data, iv_state->create_info.image);
- if (image_node)
- core_validation::AddCommandBufferBindingImage(dev_data, cb_node, image_node);
+ core_validation::AddCommandBufferBindingImageView(dev_data, cb_node, iv_state);
}
}
@@ -913,9 +911,7 @@
// Add binding for image
auto iv_state = getImageViewState(dev_data, image_view_);
if (iv_state) {
- auto image_node = getImageNode(dev_data, iv_state->create_info.image);
- if (image_node)
- core_validation::AddCommandBufferBindingImage(dev_data, cb_node, image_node);
+ core_validation::AddCommandBufferBindingImageView(dev_data, cb_node, iv_state);
}
}