Fixes incorrect usage of textureSamples().
authorDominik Witczak <Dominik.Witczak@amd.com>
Fri, 18 Nov 2016 12:13:12 +0000 (13:13 +0100)
committerPyry Haulos <phaulos@google.com>
Wed, 30 Nov 2016 20:25:39 +0000 (15:25 -0500)
The function should not be called against single-sample
images. See #538 for more details.

Tests affected: dEQP-VK.glsl.texture_functions.query.texturesamples.isampler*ms*

Change-Id: I7ce507c657b33cbcf99c9e3202fdafaee5ea1577

external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderTextureFunctionTests.cpp

index 2a0e220..276ef15 100644 (file)
@@ -1694,10 +1694,22 @@ TextureSamplesInstance::TextureSamplesInstance (Context&                                context,
                                                                                                                                                                        &properties) == vk::VK_ERROR_FORMAT_NOT_SUPPORTED)
                        TCU_THROW(NotSupportedError, "Format not supported");
 
-               // Integer pixel formats do not support multisampling, so need to add 1 MS in the list
+               // NOTE: The test case initializes MS images (for all supported N of samples), runs a program
+               //       which invokes OpImageQuerySamples against the image and checks the result.
+               //
+               //       Now, in the SPIR-V spec for the very operation we have the following language:
+               //
+               //       OpImageQuerySamples
+               //       Query the number of samples available per texel fetch in a multisample image.
+               //       Result Type must be a scalar integer type.
+               //       The result is the number of samples.
+               //       Image must be an object whose type is OpTypeImage.
+               //       Its Dim operand must be one of 2D and **MS of 1(multisampled).
+               //
+               //       "MS of 1" implies the image must not be single-sample, meaning we must exclude
+               //       VK_SAMPLE_COUNT_1_BIT in the sampleFlags array below.
                static const vk::VkSampleCountFlagBits  sampleFlags[]   =
                {
-                       vk::VK_SAMPLE_COUNT_1_BIT,
                        vk::VK_SAMPLE_COUNT_2_BIT,
                        vk::VK_SAMPLE_COUNT_4_BIT,
                        vk::VK_SAMPLE_COUNT_8_BIT,