vkd3d: Attempt to create linear image without EXTENDED_USAGE.

NVIDIA drivers apparently cannot support EXTENDED_USAGE linear
images for whatever reason, so attempt to create these images without
the creation flag.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-12-02 12:20:40 +01:00
parent 459cae5673
commit c0a3fa8adc
1 changed files with 11 additions and 0 deletions

View File

@ -612,6 +612,17 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device,
WARN("Forcing VK_IMAGE_TILING_LINEAR for CPU readable texture.\n");
image_info.tiling = VK_IMAGE_TILING_LINEAR;
}
else if (image_info.flags & VK_IMAGE_CREATE_EXTENDED_USAGE_BIT)
{
/* Apparently NV drivers do not support EXTENDED_USAGE_BIT on linear images? */
image_info.flags &= ~VK_IMAGE_CREATE_EXTENDED_USAGE_BIT;
WARN("Linear image not supported, attempting without EXTENDED_USAGE as a workaround ...\n");
if (vkd3d_is_linear_tiling_supported(device, &image_info))
{
WARN("Forcing VK_IMAGE_TILING_LINEAR for CPU readable texture.\n");
image_info.tiling = VK_IMAGE_TILING_LINEAR;
}
}
}
else
{