From 865e131b5485e4878dfb2ad93f182dd7cc415f0a Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Mon, 2 Sep 2019 12:59:03 +0200 Subject: [PATCH] Fix check support for (Sign|Zero)Extend tests Components: Vulkan Affects: dEQP-VK.image.extend_operands_spirv1p4.* Change-Id: I5c546afcfdc533957fbb7d78a0a98f8845a56a1b (cherry picked from commit aa2226758650dee8239d0b36035c41b65ec1382d) --- .../vulkan/image/vktImageLoadStoreTests.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp index 6cdc82d..12e9799 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp @@ -1508,7 +1508,6 @@ public: protected: - void checkRequirements(void); VkDescriptorSetLayout prepareDescriptors (void); void commandBeforeCompute (const VkCommandBuffer cmdBuffer); void commandBetweenShaderInvocations (const VkCommandBuffer cmdBuffer); @@ -1545,7 +1544,7 @@ ImageExtendOperandTestInstance::ImageExtendOperandTestInstance (Context& context const Texture& texture, const VkFormat format, const bool signExtend) - : BaseTestInstance (context, texture, format, true, true) + : BaseTestInstance (context, texture, format, true, true, false, false) , m_signExtend (signExtend) { const DeviceInterface& vk = m_context.getDeviceInterface(); @@ -1592,22 +1591,6 @@ ImageExtendOperandTestInstance::ImageExtendOperandTestInstance (Context& context flushAlloc(vk, device, alloc); } -void ImageExtendOperandTestInstance::checkRequirements (void) -{ - const vk::VkFormatProperties formatProperties (vk::getPhysicalDeviceFormatProperties(m_context.getInstanceInterface(), - m_context.getPhysicalDevice(), - m_format)); - - if (m_context.requireDeviceExtension("VK_KHR_spirv_1_4")) - TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported"); - - if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)) - TCU_THROW(NotSupportedError, "Format not supported for storage images"); - - if (m_texture.type() == IMAGE_TYPE_BUFFER && !(formatProperties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT)) - TCU_THROW(NotSupportedError, "Format not supported for storage texel buffers"); -} - VkDescriptorSetLayout ImageExtendOperandTestInstance::prepareDescriptors (void) { const DeviceInterface& vk = m_context.getDeviceInterface(); @@ -1737,6 +1720,7 @@ public: const VkFormat format, const bool readSigned); + void checkSupport (Context& context) const; void initPrograms (SourceCollections& programCollection) const; TestInstance* createInstance (Context& context) const; @@ -1758,6 +1742,22 @@ ImageExtendOperandTest::ImageExtendOperandTest (tcu::TestContext& testCtx, { } +void ImageExtendOperandTest::checkSupport (Context& context) const +{ + const vk::VkFormatProperties formatProperties (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(), + context.getPhysicalDevice(), + m_format)); + + if (!context.requireDeviceExtension("VK_KHR_spirv_1_4")) + TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported"); + + if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)) + TCU_THROW(NotSupportedError, "Format not supported for storage images"); + + if (m_texture.type() == IMAGE_TYPE_BUFFER && !(formatProperties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT)) + TCU_THROW(NotSupportedError, "Format not supported for storage texel buffers"); +} + void ImageExtendOperandTest::initPrograms (SourceCollections& programCollection) const { tcu::StringTemplate shaderTemplate( -- 2.7.4