mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxvk] Don't transition image layout in clearImageViewCs unless necessary
This commit is contained in:
parent
6d9e0baa27
commit
9389a0ca96
1 changed files with 8 additions and 4 deletions
|
@ -3879,10 +3879,14 @@ namespace dxvk {
|
||||||
str::format("Clear view (", dstName ? dstName : "unknown", ")").c_str()));
|
str::format("Clear view (", dstName ? dstName : "unknown", ")").c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
addImageLayoutTransition(*imageView->image(), imageView->imageSubresources(),
|
// Avoid inserting useless barriers if the image is already in the correct layout
|
||||||
VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT,
|
if (imageView->image()->info().layout != VK_IMAGE_LAYOUT_GENERAL
|
||||||
imageView->image()->isFullSubresource(vk::pickSubresourceLayers(imageView->imageSubresources(), 0), extent));
|
|| !imageView->image()->isInitialized(imageView->imageSubresources())) {
|
||||||
flushImageLayoutTransitions(cmdBuffer);
|
addImageLayoutTransition(*imageView->image(), imageView->imageSubresources(),
|
||||||
|
VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT,
|
||||||
|
imageView->image()->isFullSubresource(vk::pickSubresourceLayers(imageView->imageSubresources(), 0), extent));
|
||||||
|
flushImageLayoutTransitions(cmdBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
// Query pipeline objects to use for this clear operation
|
// Query pipeline objects to use for this clear operation
|
||||||
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
|
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
|
||||||
|
|
Loading…
Add table
Reference in a new issue