1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-01 09:25:24 +02:00

[d3d11] Fix image layout for transfer-only images

Silences validation errors in some rare scenarios.
This commit is contained in:
Philip Rebohle 2025-03-24 00:14:26 +01:00
parent bdb9e4f814
commit 905cf86d82

View File

@ -827,8 +827,9 @@ namespace dxvk {
// Filter out unnecessary flags. Transfer operations // Filter out unnecessary flags. Transfer operations
// are handled by the backend in a transparent manner. // are handled by the backend in a transparent manner.
Usage &= ~(VK_IMAGE_USAGE_TRANSFER_DST_BIT Usage &= VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT
| VK_IMAGE_USAGE_TRANSFER_SRC_BIT); | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
| VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
// Storage images require GENERAL. // Storage images require GENERAL.
if (Usage & VK_IMAGE_USAGE_STORAGE_BIT) if (Usage & VK_IMAGE_USAGE_STORAGE_BIT)
@ -837,7 +838,7 @@ namespace dxvk {
// Also use GENERAL if the image cannot be rendered to. This // Also use GENERAL if the image cannot be rendered to. This
// should not harm any hardware in practice and may avoid some // should not harm any hardware in practice and may avoid some
// redundant layout transitions for regular textures. // redundant layout transitions for regular textures.
if (Usage == VK_IMAGE_USAGE_SAMPLED_BIT) if (!(Usage & ~VK_IMAGE_USAGE_SAMPLED_BIT))
return VK_IMAGE_LAYOUT_GENERAL; return VK_IMAGE_LAYOUT_GENERAL;
// If the image is used only as an attachment, we never // If the image is used only as an attachment, we never