layers: Don't do bogus transitions in invalidateCommandBuffers
authorChris Forbes <chrisforbes@google.com>
Wed, 2 Aug 2017 00:19:52 +0000 (17:19 -0700)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 2 Aug 2017 16:19:35 +0000 (09:19 -0700)
Total nonsense like:

  RECORDING -> INVALID_INCOMPLETE -> INVALID_COMPLETE

was possible when there were two invalidations.

layers/core_validation.cpp

index 172cdbf..eaadcbf 100644 (file)
@@ -4117,7 +4117,7 @@ void invalidateCommandBuffers(const layer_data *dev_data, std::unordered_set<GLO
                     "Invalidating a command buffer that's currently being recorded: 0x%p.", cb_node->commandBuffer);
             cb_node->state = CB_INVALID_INCOMPLETE;
         }
-        else {
+        else if (cb_node->state == CB_RECORDED) {
             cb_node->state = CB_INVALID_COMPLETE;
         }
         cb_node->broken_bindings.push_back(obj);