From 11c88d314920d43dbcc585052abcd5ec5c0cfec2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20Iglesias=20Gons=C3=A1lvez?= Date: Fri, 5 Apr 2019 16:40:30 +0200 Subject: [PATCH] Missing format checks for vertex attribute and color attachments in input_ouput tests Input_output tests were not checking that the vertex attribute formats were supported by the physical device. Added a similar check for the color attachment. Affects: dEQP-VK.spirv_assembly.instruction.graphics.*input_output* Components: Vulkan VK-GL-CTS issue: 1726 Change-Id: I2987deeafc8d3cc119730993fcb30fb191be062c --- .../vktSpvAsmGraphicsShaderTestUtil.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp index 1cddef1..501e0e0 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp @@ -2569,6 +2569,30 @@ TestStatus runAndVerifyDefaultPipeline (Context& context, InstanceContext instan TCU_THROW(NotSupportedError, "Requested Float Controls features not supported"); } + // Check Interface Input/Output formats are supported + if (needInterface) + { + VkFormatProperties formatProperties; + vkInstance.getPhysicalDeviceFormatProperties(vkPhysicalDevice, instance.interfaces.getInputType().getVkFormat(), &formatProperties); + if ((formatProperties.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) == 0) + { + std::string error = "Interface Input format ("; + const std::string formatName = getFormatName(instance.interfaces.getInputType().getVkFormat()); + error += formatName + ") not supported"; + TCU_THROW(NotSupportedError, error.c_str()); + } + + vkInstance.getPhysicalDeviceFormatProperties(vkPhysicalDevice, instance.interfaces.getOutputType().getVkFormat(), &formatProperties); + if (((formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) == 0) || + ((formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT) == 0)) + { + std::string error = "Interface Output format ("; + const std::string formatName = getFormatName(instance.interfaces.getInputType().getVkFormat()); + error += formatName + ") not supported"; + TCU_THROW(NotSupportedError, error.c_str()); + } + } + de::Random(seed).shuffle(instance.inputColors, instance.inputColors+4); de::Random(seed).shuffle(instance.outputColors, instance.outputColors+4); const Vec4 vertexData[] = -- 2.7.4