aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-07-22 16:55:19 -0600
committerTobin Ehlis <tobine@google.com>2016-08-02 14:26:01 -0600
commit7832b888e612d1599be11fdebc062a0c87da42cf (patch)
treee77dee0b6fc44c6a3a2feaddaa333fcf91976583
parentf354c5e4fd64a936ca41549256bc76c1d136b4fd (diff)
downloadusermoji-7832b888e612d1599be11fdebc062a0c87da42cf.tar.xz
layers: Fix bug in cmd buffer framebuffer binding
If cmd buffers were freed via DestroyCommandPool, then the framebuffer links to the individual cb_nodes were not getting cleared. Fix that issue. This is initial, simple solution to avoid crash, need smarter solution long-term.
-rw-r--r--layers/core_validation.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index d034d4d4..6a07f71b 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -5643,9 +5643,16 @@ DestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocatio
for (auto cb : pPool->commandBuffers) {
clear_cmd_buf_and_mem_references(dev_data, cb);
auto cb_node = getCBNode(dev_data, cb);
+ // Remove references to this cb_node prior to delete
+ // TODO : Need better solution here, resetCB?
for (auto obj : cb_node->object_bindings) {
removeCommandBufferBinding(dev_data, &obj, cb_node);
}
+ for (auto framebuffer : cb_node->framebuffers) {
+ auto fb_node = getFramebuffer(dev_data, framebuffer);
+ if (fb_node)
+ fb_node->cb_bindings.erase(cb_node);
+ }
dev_data->commandBufferMap.erase(cb); // Remove this command buffer
delete cb_node; // delete CB info structure
}