layers: MR153, Correctly track inFlight cmdBuffers per queue
authorTobin Ehlis <tobine@google.com>
Wed, 20 Jan 2016 23:23:37 +0000 (16:23 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Fri, 22 Jan 2016 22:26:35 +0000 (15:26 -0700)
commitd02e9df295c8d183b5c1dd83e4c49dce4f3f11f3
treef5541106e3403069c9923bd2eb897af188bca0ab
parent192023082850653dc7bf08d3735fcb6f9fd41319
layers: MR153, Correctly track inFlight cmdBuffers per queue

There were per-queue vectors of the cmdBuffers in flight, but they were not
being consistently used/updated.
This change keeps two sets of inFlight cmdBuffers: one globally for all
cmdBuffers on the device, and one for each queue.
Ideally we could just track per-queue, but secondary command buffers are an
exception that's considered "in-flight" from the time they're recorded in a
primary command buffer with the vkCmdExecuteCommands() call so having a global
list provides a way to account for that.
Command buffers are added into both the global inFlight set and the individual
queue set at QueueSubmit time.
When cleaning up command buffers based on fences or Idle waits, correctly
remove the cmdBuffers from the appropriate queue inFlight set. Also, if the
cmdBuffer is not inFlight on any other queues, remove it from the the global
inFlight set.
Removed the deviceMap as it was only being used to hold a vector of queues.
Since layer_data struct is already per-device, just moved vector of queues
directly into layer_data struct.
layers/draw_state.cpp
layers/draw_state.h