aboutsummaryrefslogtreecommitdiff
path: root/layers/buffer_validation.cpp
diff options
context:
space:
mode:
authorAlex Smith <asmith@feralinteractive.com>2017-08-16 09:23:27 +0100
committerMark Lobodzinski <mark@lunarg.com>2017-08-16 12:16:09 -0600
commit017981f812a92665e26763f5160ba5a72a440172 (patch)
tree406ecd51eafd3663f3fc45396e7b9fe1638d3ca2 /layers/buffer_validation.cpp
parenteab39a6bd0c0b9875532001444850b4a3b69879b (diff)
downloadusermoji-017981f812a92665e26763f5160ba5a72a440172.tar.xz
layers: Fix img layout state in CmdExecuteCommands
Previously the layout state in the primary command buffer was just overwritten with the state in the secondary command buffer. This can lead to spurious errors upon submission of the primary CB, if an image used in the secondary CB is used prior to CmdExecuteCommands in the primary CB with a different initial layout. This is because the initialLayout field for the image on the primary CB is overwritten with that of the secondary CB. An example case that was incorrectly erroring (these commands refer to the same image, newly created): (primary buffer) vkCmdPipelineBarrier, transition UNDEFINED -> TRANSFER_DST_OPTIMAL vkCmdExecuteCommands (secondary buffer) ... vkCmdCopyBufferToImage, layout TRANSFER_DST_OPTIMAL Just before the CmdExecuteCommands, the image had initialLayout = UNDEFINED and layout = TRANSFER_DST_OPTIMAL on the primary CB, and initialLayout = layout = TRANSFER_DST_OPTIMAL on the secondary. After CmdExecuteCommands, the primary CB state is overwritten, so it has initialLayout = layout = TRANSFER_DST_OPTIMAL. At submission, this then errors because the global image layout is UNDEFINED. Fix by only setting initialLayout on the primary CB from the secondary if the image hasn't already been used on the primary. Change-Id: Iae248ed09b1f87598fd192ba3d6f0bcf7ad38ada
Diffstat (limited to 'layers/buffer_validation.cpp')
0 files changed, 0 insertions, 0 deletions