Fix tests dEQP-VK.draw.depth_clamp
authorArkadiusz Sarwa <arkadiusz.sarwa@amd.com>
Fri, 30 Oct 2020 13:02:54 +0000 (14:02 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 18 Nov 2020 07:53:30 +0000 (02:53 -0500)
Affected tests:
dEQP-VK.draw.depth_clamp.*

Components: Vulkan
VK-GL-CTS issue: 2638

Change-Id: I3dced361e7ea11f78bbea00a4609ebad73054d0e

android/cts/master/vk-master-2020-03-01.txt
android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/draw/vktDrawDepthClampTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp
external/vulkancts/mustpass/master/vk-default.txt

index 38cc392..024c35d 100644 (file)
@@ -181481,8 +181481,6 @@ dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_clamp_input_positive
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_bias_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_bias_clamp_input_positive
-dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_range_unrestricted_negative
-dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_range_unrestricted_positive
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint_clamp_input_positive
index 91f22f3..835624d 100644 (file)
@@ -498235,8 +498235,6 @@ dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_clamp_input_positive
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_bias_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_bias_clamp_input_positive
-dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_range_unrestricted_negative
-dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_range_unrestricted_positive
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint_clamp_input_positive
index 311ce54..55c2fb7 100644 (file)
@@ -163,6 +163,21 @@ const TestParams   depthClearValuesToTest[]                        =
        }
 };
 
+bool isUnormDepthFormat(VkFormat format)
+{
+       switch (format)
+       {
+               case VK_FORMAT_D24_UNORM_S8_UINT:
+               case VK_FORMAT_X8_D24_UNORM_PACK32:
+               case VK_FORMAT_D16_UNORM_S8_UINT:
+                       /* Special case for combined depth-stencil-unorm modes for which tcu::getTextureChannelClass()
+                          returns TEXTURECHANNELCLASS_LAST */
+                       return true;
+               default:
+                       return vk::isUnormFormat(format);
+       }
+}
+
 class DepthClampTestInstance : public TestInstance {
 public:
                                                                DepthClampTestInstance  (Context& context, const TestParams& params, const VkFormat format, const float epsilon);
@@ -380,6 +395,9 @@ tcu::TestStatus DepthClampTestInstance::iterate (void)
        };
        const tcu::ConstPixelBufferAccess       resultImage     = draw(viewport);
 
+       DE_ASSERT((isUnormDepthFormat(m_format) == false) ||
+               (m_params.expectedValue >= 0.0f && m_params.expectedValue <= 1.0f));
+
        for(int z = 0; z < resultImage.getDepth(); ++z)
        for(int y = 0; y < resultImage.getHeight(); ++y)
        for(int x = 0; x < resultImage.getWidth(); ++x)
@@ -467,20 +485,6 @@ std::string getFormatCaseName (VkFormat format)
        return de::toLower(de::toString(getFormatStr(format)).substr(10));
 }
 
-bool isUnormDepthFormat(VkFormat format)
-{
-       switch(format)
-       {
-               case VK_FORMAT_D24_UNORM_S8_UINT:
-               case VK_FORMAT_X8_D24_UNORM_PACK32:
-                       /* Special case for combined depth-stencil-unorm modes for which tcu::getTextureChannelClass()
-                          returns TEXTURECHANNELCLASS_LAST */
-                       return true;
-               default:
-                       return vk::isUnormFormat(format);
-       }
-}
-
 void createTests (tcu::TestCaseGroup* testGroup)
 {
        for(int i = 0; i < DE_LENGTH_OF_ARRAY(depthStencilImageFormatsToTest); ++i)
index 893faa4..e89654e 100644 (file)
@@ -199,7 +199,7 @@ tcu::ConstPixelBufferAccess Image::readDepth (vk::VkQueue                           queue,
                                                                                          unsigned int                          arrayElement)
 {
        DE_ASSERT(aspect == vk::VK_IMAGE_ASPECT_DEPTH_BIT);
-       tcu::TextureFormat tcuFormat = (m_format == vk::VK_FORMAT_D32_SFLOAT_S8_UINT) ? tcu::TextureFormat(tcu::TextureFormat::D, tcu::TextureFormat::FLOAT) : vk::mapVkFormat(m_format);
+       const tcu::TextureFormat tcuFormat = getDepthCopyFormat(m_format);
        m_pixelAccessData.resize(width * height * tcuFormat.getPixelSize());
        deMemset(m_pixelAccessData.data(), 0, m_pixelAccessData.size());
 
index 500ea66..c9f7529 100644 (file)
@@ -498271,8 +498271,6 @@ dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_clamp_input_positive
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_bias_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_bias_clamp_input_positive
-dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_range_unrestricted_negative
-dEQP-VK.draw.depth_clamp.d16_unorm_s8_uint_depth_range_unrestricted_positive
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint_clamp_input_negative
 dEQP-VK.draw.depth_clamp.d24_unorm_s8_uint_clamp_input_positive