mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxvk] Fix potential resolve attachment invalidation bug
This commit is contained in:
parent
c5a3aa73a0
commit
563129c863
1 changed files with 14 additions and 2 deletions
|
@ -4766,14 +4766,26 @@ namespace dxvk {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If necessary, allocate a new backing image
|
// If the application may have used the destination image as shader input in
|
||||||
|
// any way, we need to preserve its contents throughout the render pass and
|
||||||
|
// allocate new backing storage for the resolve attachment itself.
|
||||||
VkImageLayout oldLayout = dstImage->info().layout;
|
VkImageLayout oldLayout = dstImage->info().layout;
|
||||||
|
|
||||||
VkImageLayout newLayout = dstImage->pickLayout((usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
|
VkImageLayout newLayout = dstImage->pickLayout((usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
|
||||||
? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
|
? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
|
||||||
: VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
|
: VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
|
||||||
|
|
||||||
if (dstImage->info().usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
|
VkPipelineStageFlags graphicsStages = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT
|
||||||
|
| VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
|
||||||
|
| VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
|
||||||
|
| VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
|
||||||
|
| VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
|
||||||
|
|
||||||
|
if (dstImage->info().stages & graphicsStages) {
|
||||||
|
// We can only support this if we're resolving the entire resource
|
||||||
|
if (dstImage->info().numLayers != region.dstSubresource.layerCount)
|
||||||
|
return false;
|
||||||
|
|
||||||
DxvkImageUsageInfo usageInfo = { };
|
DxvkImageUsageInfo usageInfo = { };
|
||||||
usageInfo.usage = usage;
|
usageInfo.usage = usage;
|
||||||
usageInfo.viewFormatCount = 1;
|
usageInfo.viewFormatCount = 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue