mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-14 22:29:15 +01:00
[dxvk] Fix actual render target layout transitions for 3D images
Also, only emit transitions if the layouts differ.
This commit is contained in:
parent
bd87c12138
commit
0956050db6
@ -1745,7 +1745,7 @@ namespace dxvk {
|
|||||||
if (clearAspects & VK_IMAGE_ASPECT_STENCIL_BIT)
|
if (clearAspects & VK_IMAGE_ASPECT_STENCIL_BIT)
|
||||||
depthOp.loadOpS = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
depthOp.loadOpS = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
|
|
||||||
bool is3D = imageView->imageInfo().type != VK_IMAGE_TYPE_3D;
|
bool is3D = imageView->imageInfo().type == VK_IMAGE_TYPE_3D;
|
||||||
|
|
||||||
if (clearAspects == imageView->info().aspect && !is3D) {
|
if (clearAspects == imageView->info().aspect && !is3D) {
|
||||||
colorOp.loadLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
colorOp.loadLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
@ -4066,14 +4066,16 @@ namespace dxvk {
|
|||||||
DxvkBarrierSet& barriers,
|
DxvkBarrierSet& barriers,
|
||||||
const DxvkAttachment& attachment,
|
const DxvkAttachment& attachment,
|
||||||
VkImageLayout oldLayout) {
|
VkImageLayout oldLayout) {
|
||||||
barriers.accessImage(
|
if (oldLayout != attachment.view->imageInfo().layout) {
|
||||||
attachment.view->image(),
|
barriers.accessImage(
|
||||||
attachment.view->subresources(), oldLayout,
|
attachment.view->image(),
|
||||||
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
attachment.view->imageSubresources(), oldLayout,
|
||||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
|
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||||
attachment.view->imageInfo().layout,
|
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
|
||||||
attachment.view->imageInfo().stages,
|
attachment.view->imageInfo().layout,
|
||||||
attachment.view->imageInfo().access);
|
attachment.view->imageInfo().stages,
|
||||||
|
attachment.view->imageInfo().access);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4081,16 +4083,18 @@ namespace dxvk {
|
|||||||
DxvkBarrierSet& barriers,
|
DxvkBarrierSet& barriers,
|
||||||
const DxvkAttachment& attachment,
|
const DxvkAttachment& attachment,
|
||||||
VkImageLayout oldLayout) {
|
VkImageLayout oldLayout) {
|
||||||
barriers.accessImage(
|
if (oldLayout != attachment.view->imageInfo().layout) {
|
||||||
attachment.view->image(),
|
barriers.accessImage(
|
||||||
attachment.view->subresources(), oldLayout,
|
attachment.view->image(),
|
||||||
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
|
attachment.view->imageSubresources(), oldLayout,
|
||||||
VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
|
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
|
||||||
oldLayout != VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
|
VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
|
||||||
? VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : 0,
|
oldLayout != VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
|
||||||
attachment.view->imageInfo().layout,
|
? VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : 0,
|
||||||
attachment.view->imageInfo().stages,
|
attachment.view->imageInfo().layout,
|
||||||
attachment.view->imageInfo().access);
|
attachment.view->imageInfo().stages,
|
||||||
|
attachment.view->imageInfo().access);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user