diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-09-28 07:12:28 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-09-28 17:41:14 -0600 |
| commit | b0fe4a6480b366e3c4b4f77d94a5ee3e18a6c859 (patch) | |
| tree | c4bb4c30e86797a3c3108cd5052c8389eb3f86c9 | |
| parent | 62c82c247c72897f1c0c9171d8900700c10e300e (diff) | |
| download | usermoji-b0fe4a6480b366e3c4b4f77d94a5ee3e18a6c859.tar.xz | |
layers: Add binding between cmd buffer and bufferView
For a texel descriptor update, add binding between bufferView and the
command buffer as well as between underlying buffer and command buffer.
| -rw-r--r-- | layers/core_validation.cpp | 13 | ||||
| -rw-r--r-- | layers/core_validation_types.h | 1 | ||||
| -rw-r--r-- | layers/descriptor_sets.cpp | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index bf6d957e..1cc6887f 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -621,6 +621,19 @@ void AddCommandBufferBindingBuffer(const layer_data *dev_data, GLOBAL_CB_NODE *c buff_node->cb_bindings.insert(cb_node); } +// Create binding link between given buffer view node and its buffer with command buffer node +void AddCommandBufferBindingBufferView(const layer_data *dev_data, GLOBAL_CB_NODE *cb_node, BUFFER_VIEW_STATE *view_state) { + // First add bindings for bufferView + view_state->cb_bindings.insert(cb_node); + cb_node->object_bindings.insert( + {reinterpret_cast<uint64_t &>(view_state->buffer_view), VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT}); + auto buffer_node = getBufferNode(dev_data, view_state->create_info.buffer); + // Add bindings for buffer within bufferView + if (buffer_node) { + AddCommandBufferBindingBuffer(dev_data, cb_node, buffer_node); + } +} + // For every mem obj bound to particular CB, free bindings related to that CB static void clear_cmd_buf_and_mem_references(layer_data *dev_data, GLOBAL_CB_NODE *pCBNode) { if (pCBNode) { diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h index fcd81cc9..05f05f24 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -636,6 +636,7 @@ void AddCommandBufferBindingSampler(GLOBAL_CB_NODE *, SAMPLER_NODE *); void AddCommandBufferBindingImage(const layer_data *, GLOBAL_CB_NODE *, IMAGE_NODE *); void AddCommandBufferBindingImageView(const layer_data *, GLOBAL_CB_NODE *, IMAGE_VIEW_STATE *); void AddCommandBufferBindingBuffer(const layer_data *, GLOBAL_CB_NODE *, BUFFER_NODE *); +void AddCommandBufferBindingBufferView(const layer_data *, GLOBAL_CB_NODE *, BUFFER_VIEW_STATE *); } #endif // CORE_VALIDATION_TYPES_H_ diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index d08a110f..45fa3e0b 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -975,9 +975,7 @@ void cvdescriptorset::TexelDescriptor::CopyUpdate(const Descriptor *src) { void cvdescriptorset::TexelDescriptor::BindCommandBuffer(const core_validation::layer_data *dev_data, GLOBAL_CB_NODE *cb_node) { auto bv_state = getBufferViewState(dev_data, buffer_view_); if (bv_state) { - auto buffer_node = getBufferNode(dev_data, bv_state->create_info.buffer); - if (buffer_node) - core_validation::AddCommandBufferBindingBuffer(dev_data, cb_node, buffer_node); + core_validation::AddCommandBufferBindingBufferView(dev_data, cb_node, bv_state); } } |
