From 9cfe9b4b870704f81620ec1e5c53d3c0144ad8f7 Mon Sep 17 00:00:00 2001 From: scygan Date: Wed, 4 Nov 2015 19:28:51 +0100 Subject: [PATCH] Fix: renderpass does not set proper usage flags on color attachment images --- external/vulkancts/modules/vulkan/vktRenderPassTests.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp index 6a0a3d0..ce8a86b 100644 --- a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp +++ b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp @@ -1057,7 +1057,17 @@ Move createAttachmentImage (const DeviceInterface& vk, VkImageLayout layout) { const VkExtent3D size_ = { (deInt32)size.x(), (deInt32)size.y(), 1 }; - return createImage(vk, device, VK_IMAGE_TYPE_2D, format, size_, 1u /* mipLevels */, 1u /* arraySize */, samples, VK_IMAGE_TILING_OPTIMAL, usageFlags, 0u, VK_SHARING_MODE_EXCLUSIVE, 1, &queueIndex, layout); + + VkImageUsageFlags targetUsageFlags = 0; + + const tcu::TextureFormat textureFormat = mapVkFormat(format); + + if (tcu::hasDepthComponent(textureFormat.order) || tcu::hasStencilComponent(textureFormat.order)) + targetUsageFlags |= vk::VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; + else + targetUsageFlags |= vk::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + + return createImage(vk, device, VK_IMAGE_TYPE_2D, format, size_, 1u /* mipLevels */, 1u /* arraySize */, samples, VK_IMAGE_TILING_OPTIMAL, usageFlags | targetUsageFlags, 0u, VK_SHARING_MODE_EXCLUSIVE, 1, &queueIndex, layout); } de::MovePtr createImageMemory (const DeviceInterface& vk, -- 2.7.4