Psychonauts 2 creates an SRV on a swapchain image and lack of VK_IMAGE_USAGE_SAMPLED_BIT results in failure to create a Vulkan descriptor.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- dlls/dxgi/swapchain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 8d5f2f537..015a32498 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -1303,7 +1303,8 @@ static HRESULT d3d12_swapchain_create_user_buffers(struct d3d12_swapchain *swapc image_info.tiling = VK_IMAGE_TILING_OPTIMAL; image_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT - | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT + | VK_IMAGE_USAGE_SAMPLED_BIT; image_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; image_info.queueFamilyIndexCount = 0; image_info.pQueueFamilyIndices = NULL; @@ -1792,8 +1793,11 @@ static HRESULT d3d12_swapchain_create_vulkan_swapchain(struct d3d12_swapchain *s usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; usage |= surface_caps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT; usage |= surface_caps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT; + usage |= surface_caps.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT; if (!(usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) || !(usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT)) WARN("Transfer not supported for swapchain images.\n"); + if (!(usage & VK_IMAGE_USAGE_SAMPLED_BIT)) + WARN("Sampling not supported for swapchain images.\n");
vk_swapchain_desc.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; vk_swapchain_desc.pNext = NULL;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=105303
Your paranoid android.
=== debian11 (32 bit Chinese:China report) ===
dxgi: dxgi.c:3354: Test failed: Got monitor rect (0,0)-(1280,854), expected (0,0)-(1024,768). dxgi.c:3356: Test failed: Got monitor rect (0,0)-(1280,854), expected (0,0)-(1024,768). dxgi.c:3369: Test failed: Got monitor rect (0,0)-(1280,854), expected (0,0)-(1024,768).
=== debian11 (32 bit WoW report) ===
dxgi: dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1024,768). dxgi.c:3644: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1024,768). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1024,768). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1024,768).
On Mon, 17 Jan 2022 at 08:41, Conor McCarthy cmccarthy@codeweavers.com wrote:
Psychonauts 2 creates an SRV on a swapchain image and lack of VK_IMAGE_USAGE_SAMPLED_BIT results in failure to create a Vulkan descriptor.
Should adding VK_IMAGE_USAGE_SAMPLED_BIT be conditional on swapchain->desc.BufferUsage having DXGI_USAGE_SHADER_INPUT set?