aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Smith <asmith@feralinteractive.com>2017-01-10 09:51:22 +0000
committerTobin Ehlis <tobine@google.com>2017-01-10 13:41:51 -0700
commite45b4f9816f56b7af194cbcb3285b896da4ab75e (patch)
treefb2fd9b7f4b356acea6678c766ae9a1789c68cc0 /scripts
parent3912d811b95a1a8f1d3db71c2f39e73bad082b2b (diff)
downloadusermoji-e45b4f9816f56b7af194cbcb3285b896da4ab75e.tar.xz
layers: Transition each aspect individually in TransitionImageLayouts
This fixes the possibility of spurious validation errors like the following, when attempting to transition multiple aspects of an image after only a subset of those aspects have previously been used in the command buffer: "Cannot query for VkImage 0x599 layout when combined aspect mask 6 has multiple initial layout types: VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL and VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL" The specific case where this bug was encountered was where both the depth and stencil aspects of an image were initially in the TRANSFER_DST_OPTIMAL layout. The first command in the command buffer to reference the image was a vkCmdClearDepthStencilImage on only the depth aspect of the image, followed later by a vkCmdPipelineBarrier to transition both aspects to the DEPTH_STENCIL_ATTACHMENT_OPTIMAL layout. Since TransitionImageLayouts tries to look up the initial state for all aspects at the same time, it was picking up the state based on the depth aspect because of the previous use of that (which had both initialLayout and layout set to TRANSFER_DST_OPTIMAL), and then calling SetLayout for all aspects with only the new layout. Since the stencil aspect didn't have any currently recorded state, it was being added with both initialLayout and layout set to the new layout, causing a mismatch between the initialLayout for the two aspects and therefore the spurious error above. Fix by updating the state for each aspect individually.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions