Merge vk-gl-cts/vulkan-cts-1.2.7 into vk-gl-cts/vulkan-cts-1.2.8
authorMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 3 Dec 2021 22:20:44 +0000 (17:20 -0500)
committerPiotr Byszewski <piotr.byszewski@mobica.com>
Mon, 6 Dec 2021 20:57:34 +0000 (21:57 +0100)
Change-Id: I32494f04eda888304de0c56aec916eaa9f9ad011

24 files changed:
1  2 
android/cts/master/egl-master.txt
external/fetch_sources.py
external/openglcts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt
external/openglcts/data/mustpass/egl/aosp_mustpass/master/egl-master.txt
external/openglcts/modules/common/CMakeLists.txt
external/vulkancts/README.md
external/vulkancts/framework/vulkan/vkNullDriver.cpp
external/vulkancts/modules/vulkan/CMakeLists.txt
external/vulkancts/modules/vulkan/api/CMakeLists.txt
external/vulkancts/modules/vulkan/api/vktApiFormatPropertiesExtendedKHRtests.cpp
external/vulkancts/modules/vulkan/image/CMakeLists.txt
external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp
external/vulkancts/modules/vulkan/image/vktImageSampleCompressedTextureTests.cpp
external/vulkancts/modules/vulkan/mesh_shader/CMakeLists.txt
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp
external/vulkancts/modules/vulkan/pipeline/CMakeLists.txt
external/vulkancts/modules/vulkan/renderpass/CMakeLists.txt
external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp
external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp
external/vulkancts/modules/vulkan/vktTestCase.cpp
external/vulkancts/modules/vulkan/vktTestCase.hpp
external/vulkancts/scripts/gen_ext_deps.py
external/vulkancts/scripts/gen_framework.py
modules/egl/teglRobustnessTests.cpp

Simple merge
index f9b91c3a8cffd4c2ac7a5de997e8508ef14997ed,ed3724236456a7ceba8e00b0974855736e65ba81..b4d664f912644d4e4ddfb5f220f135ec994da3c7
@@@ -330,6 -330,11 +330,11 @@@ PACKAGES = 
                None,
                "449bc986ba6f4c5e10e32828783f9daef2a77644",
                "spirv-headers"),
 -              "e57864f6a51a2d56dc7f012b21957755c59aafa8",
+       GitRepo(
+               "https://github.com/KhronosGroup/Vulkan-Docs.git",
+               None,
++              "d70e01c0be7b8a7d20b186b30b29a75b18bba75d",
+               "vulkan-docs"),
        GitRepo(
                "https://github.com/google/amber.git",
                None,
Simple merge
index b8c09c971b5de116aa4f500b3f6fe8763ffc0084,b8c09c971b5de116aa4f500b3f6fe8763ffc0084..36665e87d91cd1acd518f3243ac9c176b3ef7ba2
@@@ -601,6 -601,6 +601,13 @@@ public
                                                {}
  };
  
++class BufferCollectionFUCHSIA
++{
++public:
++                                              BufferCollectionFUCHSIA         (VkDevice, const VkBufferCollectionCreateInfoFUCHSIA*)
++                                              {}
++};
++
  class CommandPool
  {
  public:
index 9015d712ff6b5ff70becaf453340d5040deb8a5d,f541018faba468f285cb6b6126424e65e6ef72b9..bbb2ce60193aeb1108db91dad9ce3262a55716bd
@@@ -92,7 -93,7 +94,8 @@@ include_directories
        ray_query
        postmortem
        reconvergence
 +      mesh_shader
+       ${DEQP_INL_DIR}
        )
  
  set(DEQP_VK_SRCS
index 680ca510beac2980c55fc17b7ecd1ea5928eb772,0000000000000000000000000000000000000000..28af31dcad0a8f27a248110b707830b527d103ee
mode 100644,000000..100644
--- /dev/null
@@@ -1,78 -1,0 +1,78 @@@
-       const VkFormatPropertiesExtendedKHR formatProperties (context.getFormatProperties(format));
-       const VkFormatPropertiesExtendedKHR requiredProperties (context.getRequiredFormatProperties(format));
 +/*-------------------------------------------------------------------------
 +* Vulkan Conformance Tests
 +* ------------------------
 +*
 +* Copyright (c) 2021 The Khronos Group Inc.
 +* Copyright (c) 2016 The Android Open Source Project
 +*
 +* Licensed under the Apache License, Version 2.0 (the "License");
 +* you may not use this file except in compliance with the License.
 +* You may obtain a copy of the License at
 +*
 +*      http://www.apache.org/licenses/LICENSE-2.0
 +*
 +* Unless required by applicable law or agreed to in writing, software
 +* distributed under the License is distributed on an "AS IS" BASIS,
 +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +* See the License for the specific language governing permissions and
 +* limitations under the License.
 +*
 +*//*!
 +* \file
 +* \brief VK_KHR_format_feature_flags2 Tests.
 +*//*--------------------------------------------------------------------*/
 +
 +#include "vktApiFormatPropertiesExtendedKHRtests.hpp"
 +#include "vktTestCase.hpp"
 +#include "vktTestCaseUtil.hpp"
 +#include "vktTestGroupUtil.hpp"
 +#include "vkStrUtil.hpp"
 +
 +namespace
 +{
 +using namespace vk;
 +using namespace vkt;
 +
 +void checkSupport (Context& context, const VkFormat format)
 +{
 +      DE_UNREF(format);
 +      context.requireDeviceFunctionality(VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME);
 +      context.requireInstanceFunctionality(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
 +}
 +
 +tcu::TestStatus test (Context& context, const VkFormat format)
 +{
++      const VkFormatProperties3KHR formatProperties (context.getFormatProperties(format));
++      const VkFormatProperties3KHR requiredProperties (context.getRequiredFormatProperties(format));
 +
 +      bool allPass = true;
 +      allPass = allPass && ((formatProperties.bufferFeatures                  & requiredProperties.bufferFeatures) == requiredProperties.bufferFeatures);
 +      allPass = allPass && ((formatProperties.linearTilingFeatures    & requiredProperties.linearTilingFeatures) == requiredProperties.linearTilingFeatures);
 +      allPass = allPass && ((formatProperties.optimalTilingFeatures   & requiredProperties.optimalTilingFeatures) == requiredProperties.optimalTilingFeatures);
 +
 +      return allPass ? tcu::TestStatus::pass("") : tcu::TestStatus::fail("");
 +}
 +
 +void createTestCases (tcu::TestCaseGroup* group)
 +{
 +      for (VkFormat format = VK_FORMAT_R4G4_UNORM_PACK8; format < VK_CORE_FORMAT_LAST; format = static_cast<VkFormat>(format+1))
 +      {
 +              std::string testName = de::toLower(std::string(getFormatName(format)).substr(10));
 +              addFunctionCase(group, testName, std::string(), checkSupport, test, format);
 +      }
 +}
 +
 +} // namespace
 +
 +namespace vkt
 +{
 +namespace api
 +{
 +
 +tcu::TestCaseGroup*   createFormatPropertiesExtendedKHRTests  (tcu::TestContext& testCtx)
 +{
 +      return createTestGroup(testCtx, "format_feature_flags2", "VK_KHR_format_feature_flags2 tests", createTestCases);
 +}
 +
 +} // api
 +} // vkt
index 8a4fc6a4a623bd73fb40c56ac642916c32a34718,45abcda4463d18ec990efe8fbf95d62ccbbae661..5dfc8bf8dd9823764430f64970c3d0fcd71f8f64
@@@ -479,10 -479,10 +479,10 @@@ StoreTest::StoreTest (tcu::TestContext
  
  void StoreTest::checkSupport (Context& context) const
  {
-       const VkFormatPropertiesExtendedKHR formatProperties (context.getFormatProperties(m_format));
 -      const VkFormatProperties formatProperties (getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), m_format));
++      const VkFormatProperties3KHR formatProperties (context.getFormatProperties(m_format));
  
 -      if (!m_declareImageFormatInShader)
 -              context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SHADER_STORAGE_IMAGE_WRITE_WITHOUT_FORMAT);
 +      if (!m_declareImageFormatInShader && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format not supported for unformatted stores via storage images");
  
        if (m_texture.type() == IMAGE_TYPE_CUBE_ARRAY)
                context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_IMAGE_CUBE_ARRAY);
@@@ -1079,9 -1077,12 +1079,9 @@@ LoadStoreTest::LoadStoreTest (tcu::Test
  
  void LoadStoreTest::checkSupport (Context& context) const
  {
-       const VkFormatPropertiesExtendedKHR formatProperties (context.getFormatProperties(m_format));
-       const VkFormatPropertiesExtendedKHR imageFormatProperties (context.getFormatProperties(m_imageFormat));
 -      const vk::VkFormatProperties    formatProperties        (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(),
 -                                                                                                                                                                                         context.getPhysicalDevice(),
 -                                                                                                                                                                                         m_format));
 -      const vk::VkFormatProperties imageFormatProperties  (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(),
 -                                                                                                                                                                                         context.getPhysicalDevice(),
 -                                                                                                                                                                                         m_imageFormat));
++      const VkFormatProperties3KHR formatProperties (context.getFormatProperties(m_format));
++      const VkFormatProperties3KHR imageFormatProperties (context.getFormatProperties(m_imageFormat));
 +
        if (m_imageLoadStoreLodAMD)
                context.requireDeviceFunctionality("VK_AMD_shader_image_load_store_lod");
  
        {
                // When the source buffer is three-component, the destination buffer is single-component.
                VkFormat dstFormat = getSingleComponentFormat(m_format);
-               const VkFormatPropertiesExtendedKHR dstFormatProperties (context.getFormatProperties(dstFormat));
 -              const vk::VkFormatProperties    dstFormatProperties     (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(),
 -                                                                                                                                                                                                 context.getPhysicalDevice(),
 -                                                                                                                                                                                                 dstFormat));
++              const VkFormatProperties3KHR dstFormatProperties (context.getFormatProperties(dstFormat));
  
                if (m_texture.type() == IMAGE_TYPE_BUFFER && !(dstFormatProperties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT))
                        TCU_THROW(NotSupportedError, "Format not supported for storage texel buffers");
@@@ -2214,26 -2166,12 +2214,26 @@@ ImageExtendOperandTest::ImageExtendOper
  {
  }
  
 -void ImageExtendOperandTest::checkSupport (Context& context) const
 +void checkFormatProperties (Context& context, VkFormat format)
  {
-       const VkFormatPropertiesExtendedKHR formatProperties (context.getFormatProperties(format));
 -      const vk::VkFormatProperties    formatProperties        (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(),
 -                                                                                                                                                                                         context.getPhysicalDevice(),
 -                                                                                                                                                                                         m_format));
++      const VkFormatProperties3KHR formatProperties (context.getFormatProperties(format));
 +
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT))
 +              TCU_THROW(NotSupportedError, "Format not supported for storage images");
 +}
 +
 +void check64BitSupportIfNeeded (Context& context, VkFormat readFormat, VkFormat writeFormat)
 +{
 +      if (is64BitIntegerFormat(readFormat) || is64BitIntegerFormat(writeFormat))
 +      {
 +              const auto& features = context.getDeviceFeatures();
 +              if (!features.shaderInt64)
 +                      TCU_THROW(NotSupportedError, "64-bit integers not supported in shaders");
 +      }
 +}
  
 +void ImageExtendOperandTest::checkSupport (Context& context) const
 +{
        if (!context.requireDeviceFunctionality("VK_KHR_spirv_1_4"))
                TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported");
  
index fa9612b6f406e28207113ec6a0240112df691a80,0000000000000000000000000000000000000000..49dfa8f08d96adcb4376aee5773bc1cee523adad
mode 100644,000000..100644
--- /dev/null
@@@ -1,689 -1,0 +1,689 @@@
-       clear(resultImage.getAccess(), tcu::IVec4(0.));
 +/*------------------------------------------------------------------------
 + * Vulkan Conformance Tests
 + * ------------------------
 + *
 + * Copyright (c) 2021 Google LLC.
 + *
 + *
 + * Licensed under the Apache License, Version 2.0 (the "License");
 + * you may not use this file except in compliance with the License.
 + * You may obtain a copy of the License at
 + *
 + *      http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + *
 + *//*!
 + * \file
 + * \brief Tests that images using a block-compressed format are sampled
 + * correctly
 + *
 + * These tests create a storage image using a 128-bit or a 64-bit
 + * block-compressed image format and an ImageView using an uncompressed
 + * format. Each test case then fills the storage image with compressed
 + * color values in a compute shader and samples the storage image. If the
 + * sampled values are pure blue, the test passes.
 + *//*--------------------------------------------------------------------*/
 +
 +#include "deUniquePtr.hpp"
 +#include "deStringUtil.hpp"
 +
 +#include "tcuVectorType.hpp"
 +#include "tcuTextureUtil.hpp"
 +#include "tcuImageCompare.hpp"
 +#include "tcuTexture.hpp"
 +
 +#include "vkDefs.hpp"
 +#include "vkRef.hpp"
 +#include "vkRefUtil.hpp"
 +#include "vkPrograms.hpp"
 +#include "vkMemUtil.hpp"
 +#include "vkBuilderUtil.hpp"
 +#include "vkImageUtil.hpp"
 +#include "vkCmdUtil.hpp"
 +#include "vkObjUtil.hpp"
 +#include "vkTypeUtil.hpp"
 +#include "vkImageWithMemory.hpp"
 +#include "vktImageTestsUtil.hpp"
 +#include "vkBarrierUtil.hpp"
 +
 +#include "vktTestCaseUtil.hpp"
 +#include "tcuTestLog.hpp"
 +
 +#include <string>
 +
 +using namespace vk;
 +
 +namespace vkt
 +{
 +namespace image
 +{
 +namespace
 +{
 +using tcu::IVec3;
 +using tcu::Vec2;
 +using tcu::Vec4;
 +using std::vector;
 +using de::MovePtr;
 +using tcu::TextureLevel;
 +using tcu::PixelBufferAccess;
 +using tcu::ConstPixelBufferAccess;
 +
 +const VkDeviceSize    BUFFERSIZE      = 100u * 1024;
 +const int                     WIDTH           = 80;
 +const int                     HEIGHT          = 80;
 +
 +inline VkImageCreateInfo makeImageCreateInfo (const IVec3& size, const VkFormat& format, bool storageImage)
 +{
 +      VkImageUsageFlags       usageFlags      = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
 +                                                                        | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
 +      VkImageCreateFlags      createFlags     = DE_NULL;
 +
 +      if (storageImage)
 +      {
 +              usageFlags      = VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT
 +                                        | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
 +              createFlags     = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
 +                                        | VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
 +      }
 +
 +      const VkImageCreateInfo imageParams     =
 +      {
 +              VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,    //  VkStructureType         sType;
 +              DE_NULL,                                                                //  const void*             pNext;
 +              createFlags,                                                    //  VkImageCreateFlags      flags;
 +              VK_IMAGE_TYPE_2D,                                               //  VkImageType             imageType;
 +              format,                                                                 //  VkFormat                format;
 +              makeExtent3D(size.x(), size.y(), 1u),   //  VkExtent3D              extent;
 +              1u,                                                                             //  deUint32                mipLevels;
 +              1u,                                                                             //  deUint32                arrayLayers;
 +              VK_SAMPLE_COUNT_1_BIT,                                  //  VkSampleCountFlagBits   samples;
 +              VK_IMAGE_TILING_OPTIMAL,                                //  VkImageTiling           tiling;
 +              usageFlags,                                                             //  VkImageUsageFlags       usage;
 +              VK_SHARING_MODE_EXCLUSIVE,                              //  VkSharingMode           sharingMode;
 +              0u,                                                                             //  deUint32                queueFamilyIndexCount;
 +              DE_NULL,                                                                //  const deUint32*         pQueueFamilyIndices;
 +              VK_IMAGE_LAYOUT_UNDEFINED,                              //  VkImageLayout           initialLayout;
 +      };
 +
 +      return imageParams;
 +}
 +
 +Move<VkBuffer> makeVertexBuffer (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
 +{
 +      const VkBufferCreateInfo vertexBufferParams =
 +      {
 +              VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,   // VkStructureType      sType;
 +              DE_NULL,                                                                // const void*          pNext;
 +              0u,                                                                             // VkBufferCreateFlags  flags;
 +              BUFFERSIZE,                                                                     // VkDeviceSize         size;
 +              VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,              // VkBufferUsageFlags   usage;
 +              VK_SHARING_MODE_EXCLUSIVE,                              // VkSharingMode        sharingMode;
 +              1u,                                                                             // deUint32             queueFamilyIndexCount;
 +              &queueFamilyIndex                                               // const deUint32*      pQueueFamilyIndices;
 +      };
 +
 +      Move<VkBuffer>                  vertexBuffer            = createBuffer(vk, device, &vertexBufferParams);;
 +      return vertexBuffer;
 +}
 +
 +class SampleDrawnTextureTestInstance : public TestInstance
 +{
 +public:
 +                                      SampleDrawnTextureTestInstance (Context&                context,
 +                                                                                                      const VkFormat  imageFormat,
 +                                                                                                      const VkFormat  imageViewFormat,
 +                                                                                                      const bool              twoSamplers);
 +      tcu::TestStatus iterate                                                 (void);
 +
 +private:
 +      const VkFormat          m_imageFormat;
 +      const VkFormat          m_imageViewFormat;
 +      const bool                      m_twoSamplers;
 +};
 +
 +SampleDrawnTextureTestInstance::SampleDrawnTextureTestInstance (Context& context, const VkFormat imageFormat, const VkFormat imageViewFormat, const bool twoSamplers)
 +      : TestInstance                                                                                     (context)
 +      , m_imageFormat         (imageFormat)
 +      , m_imageViewFormat     (imageViewFormat)
 +      , m_twoSamplers         (twoSamplers)
 +{
 +}
 +
 +template<typename T>
 +inline size_t sizeInBytes (const vector<T>& vec)
 +{
 +      return vec.size() * sizeof(vec[0]);
 +}
 +
 +Move<VkSampler> makeSampler (const DeviceInterface& vk, const VkDevice& device)
 +{
 +      const VkSamplerCreateInfo samplerParams =
 +      {
 +              VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,          // VkStructureType          sType;
 +              DE_NULL,                                                                        // const void*              pNext;
 +              (VkSamplerCreateFlags)0,                                        // VkSamplerCreateFlags     flags;
 +              VK_FILTER_NEAREST,                                                      // VkFilter                 magFilter;
 +              VK_FILTER_NEAREST,                                                      // VkFilter                 minFilter;
 +              VK_SAMPLER_MIPMAP_MODE_NEAREST,                         // VkSamplerMipmapMode      mipmapMode;
 +              VK_SAMPLER_ADDRESS_MODE_REPEAT,                         // VkSamplerAddressMode     addressModeU;
 +              VK_SAMPLER_ADDRESS_MODE_REPEAT,                         // VkSamplerAddressMode     addressModeV;
 +              VK_SAMPLER_ADDRESS_MODE_REPEAT,                         // VkSamplerAddressMode     addressModeW;
 +              0.0f,                                                                           // float                    mipLodBias;
 +              VK_FALSE,                                                                       // VkBool32                 anisotropyEnable;
 +              1.0f,                                                                           // float                    maxAnisotropy;
 +              VK_FALSE,                                                                       // VkBool32                 compareEnable;
 +              VK_COMPARE_OP_ALWAYS,                                           // VkCompareOp              compareOp;
 +              0.0f,                                                                           // float                    minLod;
 +              0.0f,                                                                           // float                    maxLod;
 +              VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,        // VkBorderColor            borderColor;
 +              VK_FALSE,                                                                       // VkBool32                 unnormalizedCoordinates;
 +      };
 +
 +      return createSampler(vk, device, &samplerParams);
 +}
 +
 +struct Vertex
 +{
 +      Vertex(Vec4 position_, Vec2 uv_) : position(position_), uv(uv_) {}
 +      Vec4 position;
 +      Vec2 uv;
 +
 +      static VkVertexInputBindingDescription                          getBindingDescription           (void);
 +      static vector<VkVertexInputAttributeDescription>        getAttributeDescriptions        (void);
 +};
 +
 +VkVertexInputBindingDescription Vertex::getBindingDescription (void)
 +{
 +      static const VkVertexInputBindingDescription desc =
 +      {
 +              0u,                                                                             // deUint32             binding;
 +              static_cast<deUint32>(sizeof(Vertex)),  // deUint32             stride;
 +              VK_VERTEX_INPUT_RATE_VERTEX,                    // VkVertexInputRate    inputRate;
 +      };
 +
 +      return desc;
 +}
 +
 +vector<VkVertexInputAttributeDescription> Vertex::getAttributeDescriptions (void)
 +{
 +      static const vector<VkVertexInputAttributeDescription> desc =
 +      {
 +              {
 +                      0u,                                                                                                     // deUint32    location;
 +                      0u,                                                                                                     // deUint32    binding;
 +                      vk::VK_FORMAT_R32G32B32A32_SFLOAT,                                      // VkFormat    format;
 +                      static_cast<deUint32>(offsetof(Vertex, position)),      // deUint32    offset;
 +              },
 +              {
 +                      1u,                                                                                                     // deUint32    location;
 +                      0u,                                                                                                     // deUint32    binding;
 +                      vk::VK_FORMAT_R32G32_SFLOAT,                                            // VkFormat    format;
 +                      static_cast<deUint32>(offsetof(Vertex, uv)),            // deUint32    offset;
 +              },
 +      };
 +
 +      return desc;
 +}
 +
 +// Generates the vertices of a full quad and texture coordinates of each vertex
 +vector<Vertex> generateVertices (void)
 +{
 +      vector<Vertex> vertices;
 +      vertices.push_back(Vertex(Vec4(-1.0f, -1.0f, 0.0f, 1.0f), Vec2(0.0f, 0.0f)));
 +      vertices.push_back(Vertex(Vec4( 1.0f, -1.0f, 0.0f, 1.0f), Vec2(1.0f, 0.0f)));
 +      vertices.push_back(Vertex(Vec4(-1.0f,  1.0f, 0.0f, 1.0f), Vec2(0.0f, 1.0f)));
 +      vertices.push_back(Vertex(Vec4( 1.0f, -1.0f, 0.0f, 1.0f), Vec2(1.0f, 0.0f)));
 +      vertices.push_back(Vertex(Vec4( 1.0f,  1.0f, 0.0f, 1.0f), Vec2(1.0f, 1.0f)));
 +      vertices.push_back(Vertex(Vec4(-1.0f,  1.0f, 0.0f, 1.0f), Vec2(0.0f, 1.0f)));
 +
 +      return vertices;
 +}
 +
 +// Generates a reference image filled with pure blue
 +TextureLevel makeReferenceImage(const VkFormat format, int width, int height)
 +{
 +      TextureLevel referenceImage(mapVkFormat(format), width, height, 1);
 +      for (int y = 0; y < height; y++)
 +              for (int x = 0; x < width; x++)
 +                      referenceImage.getAccess().setPixel(tcu::IVec4(0, 0, 255, 255), x, y, 0);
 +
 +      return referenceImage;
 +}
 +
 +tcu::TestStatus SampleDrawnTextureTestInstance::iterate (void)
 +{
 +      DE_ASSERT(m_imageFormat == VK_FORMAT_BC1_RGB_UNORM_BLOCK || m_imageFormat == VK_FORMAT_BC3_UNORM_BLOCK);
 +
 +      const DeviceInterface&                  vk                                              = m_context.getDeviceInterface();
 +      const VkDevice                                  device                                  = m_context.getDevice();
 +      Allocator&                                              allocator                               = m_context.getDefaultAllocator();
 +      const VkQueue                                   queue                                   = m_context.getUniversalQueue();
 +      const deUint32                                  queueFamilyIndex                = m_context.getUniversalQueueFamilyIndex();
 +
 +      const IVec3                                             imageSize                               = {static_cast<int>(WIDTH), HEIGHT, 1};
 +      const VkExtent2D                                renderSize                              = {deUint32(WIDTH), deUint32(HEIGHT)};
 +      const VkRect2D                                  renderArea                              = makeRect2D(makeExtent3D(WIDTH, HEIGHT, 1u));
 +      const vector<VkRect2D>                  scissors                                (1u, renderArea);
 +      const vector<VkViewport>                viewports                               (1u, makeViewport(makeExtent3D(WIDTH, HEIGHT, 1u)));
 +
 +      const Move<VkCommandPool>               cmdPool                                 = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
 +      const Move<VkCommandBuffer>             cmdBuffer                               = allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 +
 +      const Unique<VkDescriptorPool>  descriptorPool                  (DescriptorPoolBuilder().addType(VK_DESCRIPTOR_TYPE_STORAGE_IMAGE)
 +                                                                                                                                                                      .addType(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
 +                                                                                                                                                                      .addType(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
 +                                                                                                                                                                      .build(vk, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 3u));
 +      const VkFormat                                  renderedImageFormat             = VK_FORMAT_R8G8B8A8_UNORM;
 +
 +      // Create a storage image. The first pipeline fills it with pure blue and the second pipeline
 +      // uses it as a sampling source.
 +      const VkImageCreateInfo                 imageCreateInfo                 = makeImageCreateInfo(imageSize, m_imageFormat, true);
 +      const VkImageSubresourceRange   imageSubresourceRange   = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1, 0, 1);
 +      const ImageWithMemory                   storageImage                    (vk, device, m_context.getDefaultAllocator(), imageCreateInfo, MemoryRequirement::Any);
 +      Move<VkImageView>                               storageImageImageView   = makeImageView(vk, device, *storageImage, VK_IMAGE_VIEW_TYPE_2D, m_imageViewFormat, imageSubresourceRange);
 +
 +      Move<VkShaderModule>                    computeShader                   = createShaderModule (vk, device, m_context.getBinaryCollection().get("comp"), 0u);
 +
 +      // Build descriptors for the storage image
 +      const auto                                              descriptorSetLayout1    (DescriptorSetLayoutBuilder().addSingleBinding(VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, VK_SHADER_STAGE_COMPUTE_BIT)
 +                                                                                                                                                                               .build(vk, device));
 +      const Unique<VkDescriptorSet>   descriptorSet1                  (makeDescriptorSet(vk, device, *descriptorPool, *descriptorSetLayout1));
 +
 +      const VkDescriptorImageInfo             storageImageDscrInfo    = makeDescriptorImageInfo(DE_NULL, *storageImageImageView, VK_IMAGE_LAYOUT_GENERAL);
 +      DescriptorSetUpdateBuilder().writeSingle(*descriptorSet1, DescriptorSetUpdateBuilder::Location::binding(0u), VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, &storageImageDscrInfo)
 +                                                              .update(vk, device);
 +
 +      // Create a compute pipeline
 +      const VkPushConstantRange               pushConstantRange               =
 +      {
 +              VK_SHADER_STAGE_COMPUTE_BIT,    // VkShaderStageFlags    stageFlags;
 +              0u,                                                             // uint32_t              offset;
 +              (deUint32)sizeof(deUint32),             // uint32_t              size;
 +      };
 +
 +      const Move<VkPipelineLayout>    computePipelineLayout   = makePipelineLayout (vk, device, 1, &(*descriptorSetLayout1), 1, &pushConstantRange);
 +      Move<VkPipeline>                                computePipeline                 = makeComputePipeline(vk, device, *computePipelineLayout, *computeShader);
 +
 +      // The first sampler uses an uncompressed format
 +      const Unique<VkSampler>                 sampler                                 (makeSampler(vk, device));
 +      Move<VkImageView>                               sampledImageView                = makeImageView(vk, device, *storageImage, VK_IMAGE_VIEW_TYPE_2D, m_imageViewFormat, imageSubresourceRange);
 +
 +      // The second sampler uses the same format as the image
 +      const Unique<VkSampler>                 sampler2                                (makeSampler(vk, device));
 +
 +      VkImageUsageFlags                               usageFlags                              = VK_IMAGE_USAGE_TRANSFER_SRC_BIT  | VK_IMAGE_USAGE_SAMPLED_BIT;
 +      VkImageViewUsageCreateInfo              imageViewUsageInfo              =
 +      {
 +              VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR,     //VkStructureType               sType;
 +              DE_NULL,                                                                                        //const void*                   pNext;
 +              usageFlags,                                                                                     //VkImageUsageFlags             usage;
 +      };
 +
 +      Move<VkImageView>                               sampledImageView2               = makeImageView(vk, device, *storageImage, VK_IMAGE_VIEW_TYPE_2D, m_imageFormat, imageSubresourceRange, &imageViewUsageInfo);
 +
 +      // Sampled values will be rendered on this image
 +      const VkImageSubresourceRange   targetSubresourceRange  = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1, 0, 1);
 +      const VkImageCreateInfo                 targetImageCreateInfo   = makeImageCreateInfo(imageSize, renderedImageFormat, false);
 +      const ImageWithMemory                   targetImage                             (vk, device, m_context.getDefaultAllocator(), targetImageCreateInfo, MemoryRequirement::Any);
 +      Move<VkImageView>                               targetImageView                 = makeImageView(vk, device, *targetImage, VK_IMAGE_VIEW_TYPE_2D, renderedImageFormat, targetSubresourceRange);
 +
 +      // Clear the render target image as black and do a layout transition
 +      clearColorImage(vk, device, m_context.getUniversalQueue(), m_context.getUniversalQueueFamilyIndex(), targetImage.get(),
 +                                      Vec4(0, 0, 0, 0), VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
 +
 +      // Build descriptors for the samplers
 +      const VkDescriptorImageInfo             samplerDscrImageInfo    = makeDescriptorImageInfo(sampler.get(), *sampledImageView, VK_IMAGE_LAYOUT_GENERAL);
 +      const VkDescriptorImageInfo             samplerDscrImageInfo2   = makeDescriptorImageInfo(sampler2.get(), *sampledImageView2, VK_IMAGE_LAYOUT_GENERAL);
 +
 +      const auto                                              descriptorSetLayout2    (DescriptorSetLayoutBuilder()
 +                                                                              .addSingleSamplerBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, &sampler.get())
 +                                                                              .addSingleSamplerBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, &sampler2.get())
 +                                                                              .build(vk, device));
 +
 +      const Unique<VkDescriptorSet>   descriptorSet2                  (makeDescriptorSet(vk, device, *descriptorPool, *descriptorSetLayout2));
 +
 +      if (m_twoSamplers)
 +      {
 +              DescriptorSetUpdateBuilder()
 +                      .writeSingle(*descriptorSet2, DescriptorSetUpdateBuilder::Location::binding(0u), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, &samplerDscrImageInfo2)
 +                      .writeSingle(*descriptorSet2, DescriptorSetUpdateBuilder::Location::binding(1u), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, &samplerDscrImageInfo)
 +                      .update(vk, device);
 +      }
 +      else
 +      {
 +              DescriptorSetUpdateBuilder()
 +                      .writeSingle(*descriptorSet2, DescriptorSetUpdateBuilder::Location::binding(0u), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, &samplerDscrImageInfo2)
 +                      .update(vk, device);
 +      }
 +
 +      // Create a graphics pipeline layout
 +      const VkPushConstantRange               pushConstantRange2              =
 +      {
 +                      VK_SHADER_STAGE_FRAGMENT_BIT,           // VkShaderStageFlags    stageFlags;
 +                      0u,                                                                     // uint32_t              offset;
 +                      (deUint32)sizeof(deUint32),                     // uint32_t              size;
 +      };
 +
 +      const Move<VkPipelineLayout>    graphicsPipelineLayout  = makePipelineLayout (vk, device, 1, &(*descriptorSetLayout2), 1, &pushConstantRange2);
 +
 +      // Vertices for a full quad and texture coordinates for each vertex
 +      vector<Vertex>                                  vertices                                = generateVertices();
 +      Move<VkBuffer>                                  vertexBuffer                    = makeVertexBuffer(vk, device, queueFamilyIndex);
 +      de::MovePtr<Allocation>                 vertexBufferAlloc               = bindBuffer(vk, device, allocator, *vertexBuffer, MemoryRequirement::HostVisible);
 +      const VkDeviceSize                              vertexBufferOffset              = 0ull;
 +      deMemcpy(vertexBufferAlloc->getHostPtr(), &vertices[0], sizeInBytes(vertices));
 +      flushAlloc(vk, device, *vertexBufferAlloc);
 +
 +      const auto                                              vtxBindingDescription   = Vertex::getBindingDescription();
 +      const auto                                              vtxAttrDescriptions             = Vertex::getAttributeDescriptions();
 +
 +      const VkPipelineVertexInputStateCreateInfo vtxInputInfo =
 +      {
 +              VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,      // VkStructureType                             sType
 +              nullptr,                                                                                                        // const void*                                 pNext
 +              0u,                                                                                                                     // VkPipelineVertexInputStateCreateFlags       flags
 +              1u,                                                                                                                     // deUint32                                    vertexBindingDescriptionCount
 +              &vtxBindingDescription,                                                                         // const VkVertexInputBindingDescription*      pVertexBindingDescriptions
 +              static_cast<deUint32>(vtxAttrDescriptions.size()),                      // deUint32                                    vertexAttributeDescriptionCount
 +              vtxAttrDescriptions.data(),                                                                     // const VkVertexInputAttributeDescription*    pVertexAttributeDescriptions
 +      };
 +
 +      Move<VkShaderModule>                    vertexShader                    = createShaderModule(vk, device, m_context.getBinaryCollection().get("vert"), 0u);
 +      Move<VkShaderModule>                    fragmentShader                  = createShaderModule(vk, device, m_context.getBinaryCollection().get("frag"), 0u);
 +
 +      // Create a render pass, a framebuffer, and the second pipeline
 +      Move<VkRenderPass>                              renderPass                              = makeRenderPass(vk, device, renderedImageFormat, VK_FORMAT_UNDEFINED, VK_ATTACHMENT_LOAD_OP_LOAD,
 +                                                                                                                                                       VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 +      Move<VkFramebuffer>                             framebuffer                             = makeFramebuffer(vk, device, *renderPass, targetImageView.get(), renderSize.width, renderSize.height);
 +      const Move<VkPipeline>                  graphicsPipeline                = makeGraphicsPipeline(vk, device, graphicsPipelineLayout.get(), vertexShader.get(), DE_NULL,
 +                                                                                                                                                                 DE_NULL, DE_NULL, fragmentShader.get(), renderPass.get(), viewports, scissors,
 +                                                                                                                                                                 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0u, 0u, &vtxInputInfo);
 +
 +      // Create a result buffer
 +      const VkBufferCreateInfo                resultBufferCreateInfo  = makeBufferCreateInfo(BUFFERSIZE, VK_BUFFER_USAGE_TRANSFER_DST_BIT);
 +      Move<VkBuffer>                                  resultBuffer                    = createBuffer(vk, device, &resultBufferCreateInfo);
 +      MovePtr<Allocation>                             resultBufferMemory              = allocator.allocate(getBufferMemoryRequirements(vk, device, *resultBuffer), MemoryRequirement::HostVisible);
 +      TextureLevel                                    resultImage                             (mapVkFormat(renderedImageFormat), renderSize.width, renderSize.height, 1);
 +      VK_CHECK(vk.bindBufferMemory(device, *resultBuffer, resultBufferMemory->getMemory(), resultBufferMemory->getOffset()));
 +
 +      // Generate a reference image
 +      TextureLevel                                    expectedImage                   = makeReferenceImage(renderedImageFormat, WIDTH, HEIGHT);
 +
 +      beginCommandBuffer(vk, *cmdBuffer);
 +
 +      // Do a layout transition for the storage image
 +      const auto                                              barrier1                                = makeImageMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_SHADER_WRITE_BIT,
 +                                                                                                                                                                       VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL,
 +                                                                                                                                                                       storageImage.get(), imageSubresourceRange);
 +      vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, DE_NULL, 0, DE_NULL, 1u, &barrier1);
 +
 +      // Bind the descriptors and vertices
 +      vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *computePipelineLayout, 0u, 1u, &descriptorSet1.get(), 0u, DE_NULL);
 +      vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelineLayout, 0u, 1u, &descriptorSet2.get(), 0u, DE_NULL);
 +      vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &vertexBuffer.get(), &vertexBufferOffset);
 +
 +      // Fill the storage image and sample it. The second pass should sample pure blue.
 +      for (int pass = 0; pass < 2; pass++)
 +      {
 +              // If both samplers are enabled, it's not necessary to run the compute shader twice since it already writes
 +              // pure blue on the first pass. The first sampler uses an uncompressed image format so the result image
 +              // will contain garbage if the second sampler doesn't work properly.
 +              if (!m_twoSamplers || pass == 0)
 +              {
 +                      vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *computePipeline);
 +                      vk.cmdPushConstants(*cmdBuffer, *computePipelineLayout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(deInt32), &pass);
 +
 +                      vk.cmdDispatch(*cmdBuffer, WIDTH, HEIGHT, 1u);
 +
 +                      const auto barrier2 = makeImageMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL,
 +                                                                                                               VK_IMAGE_LAYOUT_GENERAL, storageImage.get(), imageSubresourceRange);
 +                      vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, DE_NULL, 0, DE_NULL, 1u, &barrier2);
 +              }
 +
 +              vk.cmdPushConstants(*cmdBuffer, *graphicsPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(deInt32), &pass);
 +
 +              vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipeline);
 +
 +              beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(0, 0, imageSize.x(), imageSize.y()), 0u, DE_NULL);
 +              vk.cmdDraw(*cmdBuffer, 6u, 1u, 0u, 0u);
 +              endRenderPass(vk, *cmdBuffer);
 +
 +              if (pass == 0)
 +              {
 +                      const auto barrier3 = makeImageMemoryBarrier(VK_ACCESS_SHADER_READ_BIT, VK_ACCESS_SHADER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL,
 +                                                                                                               VK_IMAGE_LAYOUT_GENERAL, storageImage.get(), imageSubresourceRange);
 +                      vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, DE_NULL, 0, DE_NULL, 1u, &barrier3);
 +
 +                      const auto barrier4 = makeImageMemoryBarrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
 +                                                                                                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, targetImage.get(), targetSubresourceRange);
 +                      vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0, 0, DE_NULL, 0, DE_NULL, 1u, &barrier4);
 +              }
 +      }
 +
 +      // Copy the sampled values from the target image into the result image
 +      copyImageToBuffer(vk, *cmdBuffer, *targetImage, *resultBuffer, tcu::IVec2(WIDTH, HEIGHT), VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 +
 +      endCommandBuffer(vk, *cmdBuffer);
 +      submitCommandsAndWait(vk, device, queue, *cmdBuffer);
 +
 +      invalidateAlloc(vk, device, *resultBufferMemory);
 +
++      clear(resultImage.getAccess(), tcu::IVec4(0));
 +      copy(resultImage.getAccess(), ConstPixelBufferAccess(resultImage.getFormat(), resultImage.getSize(), resultBufferMemory->getHostPtr()));
 +
 +
 +      // Each test case should render pure blue as the result
 +      bool result = tcu::floatThresholdCompare(m_context.getTestContext().getLog(), "Image Comparison", "", expectedImage.getAccess(),
 +                                                                                       resultImage.getAccess(), tcu::Vec4(0.01f), tcu::COMPARE_LOG_RESULT);
 +
 +      if (result)
 +              return tcu::TestStatus::pass("pass");
 +      else
 +              return tcu::TestStatus::fail("fail");
 +}
 +
 +class SampleDrawnTextureTest : public TestCase
 +{
 +public:
 +                                              SampleDrawnTextureTest  (tcu::TestContext&      testCtx,
 +                                                                                               const std::string&     name,
 +                                                                                               const std::string&     description,
 +                                                                                               const VkFormat         imageFormat,
 +                                                                                               const VkFormat         imageViewFormat,
 +                                                                                               const bool                     twoSamplers);
 +
 +      void                            initPrograms                    (SourceCollections& programCollection) const;
 +      TestInstance*           createInstance                  (Context&                       context) const;
 +      virtual void            checkSupport                    (Context& context) const;
 +
 +private:
 +      const VkFormat          m_imageFormat;
 +      const VkFormat          m_imageViewFormat;
 +      const bool                      m_twoSamplers;
 +};
 +
 +SampleDrawnTextureTest::SampleDrawnTextureTest (tcu::TestContext&     testCtx,
 +                                                                                              const std::string&      name,
 +                                                                                              const std::string&      description,
 +                                                                                              const VkFormat          imageFormat,
 +                                                                                              const VkFormat          imageViewFormat,
 +                                                                                              const bool                      twoSamplers)
 +      : TestCase      (testCtx, name, description)
 +      , m_imageFormat (imageFormat)
 +      , m_imageViewFormat     (imageViewFormat)
 +      , m_twoSamplers (twoSamplers)
 +{
 +}
 +
 +void SampleDrawnTextureTest::checkSupport(Context& context) const
 +{
 +      const auto&                             vki                                     = context.getInstanceInterface();
 +      const auto                              physicalDevice          = context.getPhysicalDevice();
 +      const auto                              usageFlags                      = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
 +                                                                                                | VK_IMAGE_USAGE_SAMPLED_BIT;
 +      const bool                              haveMaintenance2        = context.isDeviceFunctionalitySupported("VK_KHR_maintenance2");
 +
 +      // Check that:
 +      // - An image can be created with usage flags that are not supported by the image format
 +      //   but are supported by an image view created for the image.
 +      // - VkImageViewUsageCreateInfo can be used to override implicit usage flags derived from the image.
 +      if (!haveMaintenance2)
 +              TCU_THROW(NotSupportedError, "Device does not support extended image usage flags nor overriding implicit usage flags");
 +
 +      VkImageFormatProperties imageFormatProperties;
 +
 +      if (vki.getPhysicalDeviceImageFormatProperties(physicalDevice, VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_IMAGE_TYPE_2D,
 +                                                                                                 VK_IMAGE_TILING_OPTIMAL, usageFlags, (VkImageCreateFlags)0,
 +                                                                                                 &imageFormatProperties) == VK_ERROR_FORMAT_NOT_SUPPORTED)
 +              TCU_THROW(NotSupportedError, "BC1 compressed texture formats not supported.");
 +
 +      if (vki.getPhysicalDeviceImageFormatProperties(physicalDevice, VK_FORMAT_BC3_UNORM_BLOCK, VK_IMAGE_TYPE_2D,
 +                                                                                                 VK_IMAGE_TILING_OPTIMAL, usageFlags, (VkImageCreateFlags)0,
 +                                                                                                 &imageFormatProperties) == VK_ERROR_FORMAT_NOT_SUPPORTED)
 +              TCU_THROW(NotSupportedError, "BC3 compressed texture formats not supported.");
 +}
 +
 +void SampleDrawnTextureTest::initPrograms (SourceCollections& programCollection) const
 +{
 +      // Pure blue and pure red compressed with the BC1 and BC3 algorithms.
 +      std::string bc1_red = " uvec4(4160813056u, 0u, 4160813056u, 0u);\n";
 +      std::string bc1_blue = "uvec4(2031647, 0u, 2031647, 0u);\n";
 +      std::string bc3_red = " uvec4(4294967295u, 4294967295u, 4160813056u, 0u);\n";
 +      std::string bc3_blue = "uvec4(4294967295u, 4294967295u, 2031647, 0u);\n";
 +
 +      std::ostringstream computeSrc;
 +      computeSrc
 +              << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
 +              << "layout(set = 0, binding = 0, rgba32ui) uniform highp uimage2D img;\n"
 +              << "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n";
 +              if (!m_twoSamplers)
 +              {
 +                      computeSrc
 +                      << "layout(push_constant) uniform constants {\n"
 +                      << "     int pass;\n"
 +                      << "} pc;\n";
 +              }
 +              computeSrc << "void main() {\n";
 +              if (m_twoSamplers)
 +              {
 +                      computeSrc << "    uvec4 color = ";
 +                      m_imageFormat == VK_FORMAT_BC1_RGB_UNORM_BLOCK ? computeSrc << bc1_blue : computeSrc << bc3_blue;
 +              }
 +              else
 +              {
 +                      computeSrc << "    uvec4 color = ";
 +                      m_imageFormat == VK_FORMAT_BC1_RGB_UNORM_BLOCK ? computeSrc << bc1_red : computeSrc << bc3_red;
 +
 +                      computeSrc << "     if (pc.pass == 1) { \n";
 +                      computeSrc << "        color = ";
 +                      m_imageFormat == VK_FORMAT_BC1_RGB_UNORM_BLOCK ? computeSrc << bc1_blue : computeSrc << bc3_blue;
 +                      computeSrc << "    }\n";
 +              }
 +              computeSrc
 +              << "    for (int x = 0; x < " << WIDTH << "; x++) {\n"
 +              << "        for (int y = 0; y < " << HEIGHT << "; y++) {\n"
 +              << "            imageStore(img, ivec2(x, y), color);\n"
 +              << "        }\n"
 +              << "    }\n"
 +              << "}\n";
 +
 +      std::ostringstream vertexSrc;
 +      vertexSrc
 +              << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
 +              << "layout(location = 0) in highp vec4 a_position;\n"
 +              << "layout(location = 1) in vec2 inTexCoord;\n"
 +              << "layout(location = 1) out vec2 fragTexCoord;\n"
 +              << "void main (void) {\n"
 +              << "    gl_Position = a_position;\n"
 +              << "    fragTexCoord = inTexCoord;\n"
 +              << "}\n";
 +
 +      std::ostringstream fragmentSrc;
 +      fragmentSrc
 +              << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
 +              << "layout(location = 0) out vec4 outColor;\n"
 +              << "layout(location = 1) in vec2 fragTexCoord;\n"
 +              << "layout(binding = 0) uniform sampler2D compressedTexSampler;\n";
 +              if (m_twoSamplers)
 +              {
 +                      fragmentSrc
 +                                      << "layout(binding = 1) uniform usampler2D texSampler;\n"
 +                                      << "layout(push_constant) uniform constants {\n"
 +                                      << "     int pass;\n"
 +                                      << "} pc;\n";
 +              }
 +              fragmentSrc << "void main() {\n";
 +              if (m_twoSamplers)
 +              {
 +                      fragmentSrc
 +                      << "     if (pc.pass == 1) { \n"
 +                      << "         outColor = texture(compressedTexSampler, fragTexCoord);\n"
 +                      << "     } else {\n"
 +                      << "         outColor = texture(texSampler, fragTexCoord);\n"
 +                      << "     }";
 +              } else
 +                      fragmentSrc << "outColor = texture(compressedTexSampler, fragTexCoord);\n";
 +
 +      fragmentSrc << "}\n";
 +
 +      programCollection.glslSources.add("comp") << glu::ComputeSource(computeSrc.str());
 +      programCollection.glslSources.add("vert") << glu::VertexSource(vertexSrc.str());
 +      programCollection.glslSources.add("frag") << glu::FragmentSource(fragmentSrc.str());
 +}
 +
 +TestInstance* SampleDrawnTextureTest::createInstance (Context& context) const
 +{
 +      return new SampleDrawnTextureTestInstance(context, m_imageFormat, m_imageViewFormat, m_twoSamplers);
 +}
 +
 +} // anonymous ns
 +
 +tcu::TestCaseGroup* createImageSampleDrawnTextureTests        (tcu::TestContext& testCtx)
 +{
 +      /* If both samplers are enabled, the test works as follows:
 +       *
 +       * Pass 0:
 +       * - Compute shader fills a storage image with values that are pure blue compressed with
 +       *   either the BC1 or BC3 algorithm.
 +       * - Fragment shader samples the image and draws the values on a target image.
 +       * - As the sampled values are accessed through an image view using an uncompressed
 +       *   format, they remain compressed and the drawn image ends up being garbage.
 +       * Pass 1:
 +       * - Fragment shader samples the image. On this pass, the image view uses
 +       *   a block-compressed format and correctly interprets the sampled values.
 +       * - As the values are uncompressed now, the target image is filled
 +       *   with pure blue and the test passes.
 +
 +       * Only one sampler enabled:
 +       * Pass 0:
 +       * - Compute shader fills a storage image with values that are pure red compressed
 +       *   with either the BC1 or BC3 algorithm.
 +       * - Fragment shader samples the image through an image view which interprets the values
 +       *   correctly. The values are drawn on a target image. The test doesn't pass yet
 +       *   since the image is red.
 +       * Pass 1:
 +       * - Compute shader fills the storage image with values that are pure blue compressed
 +       *   with the same algorithm as on the previous pass.
 +       * - Fragment shader samples the image through a image view which interprets the values
 +       *   correctly. The values are drawn on the target image and the test passes.
 +       */
 +
 +      const bool twoSamplers = true;
 +
 +      de::MovePtr<tcu::TestCaseGroup> testGroup(new tcu::TestCaseGroup(testCtx, "sample_texture", "Sample texture that has been rendered to tests"));
 +
 +      testGroup->addChild(new SampleDrawnTextureTest(testCtx, "64_bit_compressed_format", "", VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_R32G32_UINT, !twoSamplers));
 +      testGroup->addChild(new SampleDrawnTextureTest(testCtx, "64_bit_compressed_format_two_samplers", "", VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_R32G32_UINT, twoSamplers));
 +      testGroup->addChild(new SampleDrawnTextureTest(testCtx, "128_bit_compressed_format", "", VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_R32G32B32A32_UINT, !twoSamplers));
 +      testGroup->addChild(new SampleDrawnTextureTest(testCtx, "128_bit_compressed_format_two_samplers", "", VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_R32G32B32A32_UINT, twoSamplers));
 +
 +      return testGroup.release();
 +}
 +
 +} // image
 +} // vkt
index 0468d8af8b6a8ef0b47b44e4021f60707918a88b,0000000000000000000000000000000000000000..5401b2014467abfec0c987cb706c3546eb9e7064
mode 100644,000000..100644
--- /dev/null
@@@ -1,28 -1,0 +1,31 @@@
- include_directories(..)
++include_directories(
++      ..
++      ${DEQP_INL_DIR}
++      )
 +
 +set(DEQP_VK_MESH_SHADER_SRCS
 +      vktMeshShaderTests.cpp
 +      vktMeshShaderTests.hpp
 +      vktMeshShaderSyncTests.cpp
 +      vktMeshShaderSyncTests.hpp
 +      vktMeshShaderSmokeTests.cpp
 +      vktMeshShaderSmokeTests.hpp
 +      vktMeshShaderApiTests.cpp
 +      vktMeshShaderApiTests.hpp
 +      vktMeshShaderPropertyTests.cpp
 +      vktMeshShaderPropertyTests.hpp
 +      vktMeshShaderBuiltinTests.cpp
 +      vktMeshShaderBuiltinTests.hpp
 +      vktMeshShaderMiscTests.cpp
 +      vktMeshShaderMiscTests.hpp
 +      )
 +
 +set(DEQP_VK_MESH_SHADER_LIBS
 +      tcutil
 +      vkutil
 +      )
 +
 +PCH(DEQP_VK_MESH_SHADER_SRCS ../pch.cpp)
 +
 +add_library(deqp-vk-mesh-shader STATIC ${DEQP_VK_MESH_SHADER_SRCS})
 +target_link_libraries(deqp-vk-mesh-shader ${DEQP_VK_MESH_SHADER_LIBS})
index 1e91bd587c6f7964eae1fe21e9d0311d90caa4c2,a0c4d72db72527a84c48e0b8c9b617440de39733..ca0281fb8a5f985966378d2bfaf0ce2592d866fa
@@@ -3072,9 -2795,9 +3072,9 @@@ tcu::TestStatus MultiViewReadbackTestIn
                const VkAttachmentLoadOp                                        loadOp                  = (!fullClearPass) ? VK_ATTACHMENT_LOAD_OP_LOAD :
                                                                                                                                          (m_parameters.viewIndex == TEST_TYPE_READBACK_WITH_IMPLICIT_CLEAR) ? VK_ATTACHMENT_LOAD_OP_CLEAR :
                                                                                                                                          (m_parameters.viewIndex == TEST_TYPE_READBACK_WITH_EXPLICIT_CLEAR) ? VK_ATTACHMENT_LOAD_OP_DONT_CARE :
-                                                                                                                                         VK_ATTACHMENT_LOAD_OP_MAX_ENUM;
+                                                                                                                                         VK_ATTACHMENT_LOAD_OP_DONT_CARE;
 -              Unique<VkRenderPass>                                            renderPass              (makeRenderPass (*m_device, *m_logicalDevice, m_parameters.colorFormat, m_parameters.viewMasks, m_parameters.renderPassType, VK_SAMPLE_COUNT_1_BIT, loadOp));
 -              Unique<VkFramebuffer>                                           frameBuffer             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, m_colorAttachment->getImageView(), m_parameters.extent.width, m_parameters.extent.height));
 +              Move<VkRenderPass>                                                      renderPass;
 +              Move<VkFramebuffer>                                                     frameBuffer;
                Unique<VkPipelineLayout>                                        pipelineLayout  (makePipelineLayout(*m_device, *m_logicalDevice));
                vector<PipelineSp>                                                      pipelines               (subpassCount);
                map<VkShaderStageFlagBits, ShaderModuleSP>      shaderModule;
index 2385749fb63c0dae39edf0feaa598c148798a6b5,037cdacdb6145a0a2f7689323dc41a349ff924f9..30828f6e3b57cddd5e36a4cc5b3ce1f3be486822
@@@ -2,7 -2,7 +2,8 @@@
  
  include_directories(
        ..
 +      ../draw
+       ${DEQP_INL_DIR}
        )
  
  set(DEQP_VK_RENDER_PASS_SRCS
index c740d5b17e49734f040516d56926ec8f3d747193,1fe32f646a3b66ccbc7f74ae8c05462fdf3414d7..1cc672367626cd5c793878a27a5a26cb61affd96
@@@ -456,14 -456,9 +456,14 @@@ void RobustnessExtsTestCase::checkSuppo
                TCU_THROW(NotSupportedError, "Vulkan 1.1 not supported");
  
        if ((m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER || m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) &&
 -              !m_data.formatQualifier &&
 -              (!features2.features.shaderStorageImageReadWithoutFormat || !features2.features.shaderStorageImageWriteWithoutFormat))
 -              TCU_THROW(NotSupportedError, "shaderStorageImageReadWithoutFormat or shaderStorageImageWriteWithoutFormat not supported");
 +              !m_data.formatQualifier)
 +      {
-               const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(m_data.format);
++              const VkFormatProperties3KHR formatProperties = context.getFormatProperties(m_data.format);
 +              if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR))
 +                      TCU_THROW(NotSupportedError, "Format does not support reading without format");
 +              if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR))
 +                      TCU_THROW(NotSupportedError, "Format does not support writing without format");
 +      }
  
        if (m_data.pushDescriptor)
                context.requireDeviceFunctionality("VK_KHR_push_descriptor");
index 2b9676ae9058510b81b49a903cd8d9ae3aca16f7,b0280652d329db8e776fdf2cfbea513fb0064f4c..1bca6f6113033f0ced6845d9feaf9bc8c23401ec
@@@ -205,13 -205,6 +205,13 @@@ bool verifyTexCompareResult (tcu::TestC
        return numFailedPixels == 0;
  }
  
-       const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(testParameters.format);
 +void checkTextureSupport (Context& context, const Texture2DShadowTestCaseParameters& testParameters)
 +{
++      const VkFormatProperties3KHR formatProperties = context.getFormatProperties(testParameters.format);
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format does not support shadow sampling");
 +}
 +
  class Texture2DShadowTestInstance : public TestInstance
  {
  public:
@@@ -417,14 -410,6 +417,14 @@@ struct TextureCubeShadowTestCaseParamet
  {
  };
  
-       const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(testParameters.format);
 +void checkTextureSupport (Context& context, const TextureCubeShadowTestCaseParameters& testParameters)
 +{
++      const VkFormatProperties3KHR formatProperties = context.getFormatProperties(testParameters.format);
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format does not support shadow sampling");
 +}
 +
 +
  class TextureCubeShadowTestInstance : public TestInstance
  {
  public:
@@@ -643,13 -628,6 +643,13 @@@ struct Texture2DArrayShadowTestCasePara
  {
  };
  
-       const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(testParameters.format);
 +void checkTextureSupport (Context& context, const Texture2DArrayShadowTestCaseParameters& testParameters)
 +{
++      const VkFormatProperties3KHR formatProperties = context.getFormatProperties(testParameters.format);
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format does not support shadow sampling");
 +}
 +
  class Texture2DArrayShadowTestInstance : public TestInstance
  {
  public:
@@@ -861,13 -839,6 +861,13 @@@ struct Texture1DShadowTestCaseParameter
  {
  };
  
-       const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(testParameters.format);
 +void checkTextureSupport (Context& context, const Texture1DShadowTestCaseParameters& testParameters)
 +{
++      const VkFormatProperties3KHR formatProperties = context.getFormatProperties(testParameters.format);
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format does not support shadow sampling");
 +}
 +
  class Texture1DShadowTestInstance : public TestInstance
  {
  public:
@@@ -1072,13 -1043,6 +1072,13 @@@ struct Texture1DArrayShadowTestCasePara
  {
  };
  
-       const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(testParameters.format);
 +void checkTextureSupport (Context& context, const Texture1DArrayShadowTestCaseParameters& testParameters)
 +{
++      const VkFormatProperties3KHR formatProperties = context.getFormatProperties(testParameters.format);
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format does not support shadow sampling");
 +}
 +
  class Texture1DArrayShadowTestInstance : public TestInstance
  {
  public:
@@@ -1287,13 -1251,6 +1287,13 @@@ struct TextureCubeArrayShadowTestCasePa
  {
  };
  
-       const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(testParameters.format);
 +void checkTextureSupport (Context& context, const TextureCubeArrayShadowTestCaseParameters& testParameters)
 +{
++      const VkFormatProperties3KHR formatProperties = context.getFormatProperties(testParameters.format);
 +      if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR))
 +              TCU_THROW(NotSupportedError, "Format does not support shadow sampling");
 +}
 +
  class TextureCubeArrayShadowTestInstance : public TestInstance
  {
  public:
index e0c66f98836afcdfa8ec05ffda1d5386afc0368c,18df21fb5de95d03e3e86076b7064c4f86fb665b..e79125e8cabc12bd68f9b32fb013c3ae25887ebd
@@@ -688,125 -687,6 +688,125 @@@ bool Context::requireDeviceCoreFeature 
        return true;
  }
  
- vk::VkFormatPropertiesExtendedKHR Context::getRequiredFormatProperties(const vk::VkFormat& format) const
 +static bool isExtendedStorageFormat (VkFormat format)
 +{
 +      switch(format)
 +      {
 +              case VK_FORMAT_R8G8B8A8_UNORM:
 +              case VK_FORMAT_R8G8B8A8_SNORM:
 +              case VK_FORMAT_R8G8B8A8_UINT:
 +              case VK_FORMAT_R8G8B8A8_SINT:
 +              case VK_FORMAT_R32_UINT:
 +              case VK_FORMAT_R32_SINT:
 +              case VK_FORMAT_R32_SFLOAT:
 +              case VK_FORMAT_R32G32_UINT:
 +              case VK_FORMAT_R32G32_SINT:
 +              case VK_FORMAT_R32G32_SFLOAT:
 +              case VK_FORMAT_R32G32B32A32_UINT:
 +              case VK_FORMAT_R32G32B32A32_SINT:
 +              case VK_FORMAT_R32G32B32A32_SFLOAT:
 +              case VK_FORMAT_R16G16B16A16_UINT:
 +              case VK_FORMAT_R16G16B16A16_SINT:
 +              case VK_FORMAT_R16G16B16A16_SFLOAT:
 +              case VK_FORMAT_R16G16_SFLOAT:
 +              case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
 +              case VK_FORMAT_R16_SFLOAT:
 +              case VK_FORMAT_R16G16B16A16_UNORM:
 +              case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
 +              case VK_FORMAT_R16G16_UNORM:
 +              case VK_FORMAT_R8G8_UNORM:
 +              case VK_FORMAT_R16_UNORM:
 +              case VK_FORMAT_R8_UNORM:
 +              case VK_FORMAT_R16G16B16A16_SNORM:
 +              case VK_FORMAT_R16G16_SNORM:
 +              case VK_FORMAT_R8G8_SNORM:
 +              case VK_FORMAT_R16_SNORM:
 +              case VK_FORMAT_R8_SNORM:
 +              case VK_FORMAT_R16G16_SINT:
 +              case VK_FORMAT_R8G8_SINT:
 +              case VK_FORMAT_R16_SINT:
 +              case VK_FORMAT_R8_SINT:
 +              case VK_FORMAT_A2B10G10R10_UINT_PACK32:
 +              case VK_FORMAT_R16G16_UINT:
 +              case VK_FORMAT_R8G8_UINT:
 +              case VK_FORMAT_R16_UINT:
 +              case VK_FORMAT_R8_UINT:
 +                      return true;
 +              default:
 +                      return false;
 +      }
 +}
 +
 +static bool isDepthFormat (VkFormat format)
 +{
 +      switch(format)
 +      {
 +              case VK_FORMAT_D16_UNORM:
 +              case VK_FORMAT_X8_D24_UNORM_PACK32:
 +              case VK_FORMAT_D32_SFLOAT:
 +              case VK_FORMAT_D16_UNORM_S8_UINT:
 +              case VK_FORMAT_D24_UNORM_S8_UINT:
 +              case VK_FORMAT_D32_SFLOAT_S8_UINT:
 +                      return true;
 +              default:
 +                      return false;
 +      }
 +}
 +
-       vk::VkFormatPropertiesExtendedKHR p;
-       p.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_EXTENDED_KHR;
++vk::VkFormatProperties3KHR Context::getRequiredFormatProperties(const vk::VkFormat& format) const
 +{
- vk::VkFormatPropertiesExtendedKHR Context::getFormatProperties(const vk::VkFormat& format) const
++      vk::VkFormatProperties3KHR p;
++      p.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR;
 +      p.pNext = DE_NULL;
 +
 +      vk::VkFormatProperties properties;
 +      getInstanceInterface().getPhysicalDeviceFormatProperties(getPhysicalDevice(), format, &properties);
 +      p.linearTilingFeatures  = properties.linearTilingFeatures;
 +      p.optimalTilingFeatures = properties.optimalTilingFeatures;
 +      p.bufferFeatures                = properties.bufferFeatures;
 +
 +      const vk::VkPhysicalDeviceFeatures& featuresAvailable = getDeviceFeatures();
 +      if (isExtendedStorageFormat(format) && featuresAvailable.shaderStorageImageReadWithoutFormat)
 +      {
 +              if (p.linearTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR)
 +                      p.linearTilingFeatures  |= VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR;
 +              if (p.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR)
 +                      p.optimalTilingFeatures |= VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR;
 +      }
 +      if (isExtendedStorageFormat(format) && featuresAvailable.shaderStorageImageWriteWithoutFormat)
 +      {
 +              if (p.linearTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR)
 +                      p.linearTilingFeatures  |= VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR;
 +              if (p.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR)
 +                      p.optimalTilingFeatures |= VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR;
 +      }
 +      if (isDepthFormat(format) && (p.linearTilingFeatures & (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR)))
 +              p.linearTilingFeatures |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR;
 +      if (isDepthFormat(format) && (p.optimalTilingFeatures & (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR)))
 +              p.optimalTilingFeatures |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR;
 +
 +      return p;
 +}
 +
-               vk::VkFormatPropertiesExtendedKHR p;
-               p.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_EXTENDED_KHR;
++vk::VkFormatProperties3KHR Context::getFormatProperties(const vk::VkFormat& format) const
 +{
 +      if (isDeviceFunctionalitySupported(VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME)) // "VK_KHR_format_feature_flags2"
 +      {
++              vk::VkFormatProperties3KHR p;
++              p.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR;
 +              p.pNext = DE_NULL;
 +
 +              vk::VkFormatProperties2 properties;
 +              properties.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
 +              properties.pNext = &p;
 +
 +              getInstanceInterface().getPhysicalDeviceFormatProperties2(getPhysicalDevice(), format, &properties);
 +              return p;
 +      }
 +      else
 +              return Context::getRequiredFormatProperties(format);
 +}
 +
  void* Context::getInstanceProcAddr    ()
  {
        return (void*)m_platformInterface.getGetInstanceProcAddr();
index 65dfe87e8a775ca1fdaa46b0f736c046cdda4823,6b5ab92e56534060f93ef63191e237abce30dcc7..c555c6d578b161b5c293d8d5266ff5d701e1ce92
@@@ -107,9 -107,6 +107,9 @@@ public
        bool                                                                                    requireInstanceFunctionality            (const std::string& required) const;
        bool                                                                                    requireDeviceCoreFeature                        (const DeviceCoreFeature requiredDeviceCoreFeature);
  
-       vk::VkFormatPropertiesExtendedKHR                               getFormatProperties                                     (const vk::VkFormat&    format) const;
-       vk::VkFormatPropertiesExtendedKHR                               getRequiredFormatProperties                     (const vk::VkFormat&    format) const;
++      vk::VkFormatProperties3KHR                                              getFormatProperties                                     (const vk::VkFormat&    format) const;
++      vk::VkFormatProperties3KHR                                              getRequiredFormatProperties                     (const vk::VkFormat&    format) const;
 +
        void*                                                                                   getInstanceProcAddr                                     ();
  
        bool                                                                                    isBufferDeviceAddressSupported          (void) const;
index 739df16429c95085a972c0c67205d3913594e248,892268738ac13e463069a65de6f107bd73f3e9bb..b9519dbda7d0b8a255e3d659fe9245fc92dc48df
@@@ -76,26 -76,16 +77,26 @@@ def genApiVersions(name, apiVersions)
                yield '\tstd::make_tuple({}, {}, {}),'.format(version, major, minor)
        yield '};'
  
- def genExtDepInl(dependenciesAndVersions):
 +def genRequiredCoreVersions(name, coreVersionsDict):
 +      yield 'static const std::tuple<deUint32, deUint32, const char*>\t{}[]\t ='.format(name)
 +      yield '{'
 +      extNames = sorted(coreVersionsDict.keys())
 +      for extName in extNames:
 +              (major, minor) = coreVersionsDict[extName]
 +              yield '\tstd::make_tuple({}, {}, "{}"),'.format(major, minor, extName)
 +      yield '};'
 +
 -      allExtDepsDict, apiVersions = dependenciesAndVersions
+ def genExtDepInl(dependenciesAndVersions, filename):
 +      allExtDepsDict, apiVersions, allExtCoreVersions = dependenciesAndVersions
        apiVersions.reverse()
        lines = []
  
 -      lines = lines + [line for line in genExtDepArray(VK_EXT_DEP_INSTANCE, allExtDepsDict[VK_EXT_TYPE_INSTANCE])]
 -      lines = lines + [line for line in genExtDepArray(VK_EXT_DEP_DEVICE, allExtDepsDict[VK_EXT_TYPE_DEVICE])]
 -      lines = lines + [line for line in genApiVersions(VK_EXT_API_VERSIONS, apiVersions)]
 +      lines.extend(genExtDepArray(VK_EXT_DEP_INSTANCE, allExtDepsDict[VK_EXT_TYPE_INSTANCE]))
 +      lines.extend(genExtDepArray(VK_EXT_DEP_DEVICE, allExtDepsDict[VK_EXT_TYPE_DEVICE]))
 +      lines.extend(genApiVersions(VK_EXT_API_VERSIONS, apiVersions))
 +      lines.extend(genRequiredCoreVersions(VK_EXT_CORE_VERSIONS, allExtCoreVersions))
  
-       writeInlFile(VK_INL_FILE, lines)
+       writeInlFile(filename, lines)
  
  class extInfo:
        def __init__(self):
index d7efaefea3a9c38466563018ff5140095950199b,8b1cd4c3067b3db379373102ce1d104321f98994..8f0be5ac04f6799f13ae93204c07af043afce7d2
@@@ -131,6 -142,6 +131,7 @@@ def prefixName (prefix, name)
        name = name.replace("VIEWPORT_W", "VIEWPORT_W_")
        name = name.replace("_IDPROPERTIES", "_ID_PROPERTIES")
        name = name.replace("PHYSICAL_DEVICE_SHADER_FLOAT_16_INT_8_FEATURES", "PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES")
++      name = name.replace("PHYSICAL_DEVICE_RGBA_10_X_6_FORMATS_FEATURES_EXT", "PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT")
        name = name.replace("_PCIBUS_", "_PCI_BUS_")
        name = name.replace("ASTCD", "ASTC_D")
        name = name.replace("AABBNV", "AABB_NV")
@@@ -645,7 -655,7 +646,7 @@@ def parseDefinitions (extensionName, sr
                        return False
                if definition[0].startswith(extNameUpper):
                        return True
--              if definition[1].isdigit():
++              if definition[0].endswith("_H_"):
                        return True
                return False
  
@@@ -1478,7 -1481,7 +1479,10 @@@ def writeTypeUtil (api, filename)
                        "StdVideoH265PpsFlags",
                        "StdVideoDecodeH265PictureInfoFlags",
                        "StdVideoDecodeH265ReferenceInfoFlags",
--                      "StdVideoEncodeH265PictureInfoFlags"
++                      "StdVideoEncodeH265PictureInfoFlags",
++                      "StdVideoEncodeH265SliceHeaderFlags",
++                      "StdVideoEncodeH265ReferenceModificationFlags",
++                      "StdVideoEncodeH265ReferenceInfoFlags",
                ])
        COMPOSITE_TYPES = set([t.name for t in api.compositeTypes if not t.isAlias])
  
@@@ -1890,6 -1893,6 +1894,9 @@@ def generateDeviceFeaturesDefs(src)
                                sType = "ASTC_DECODE_MODE"
                        if sType in {'VULKAN_1_1', 'VULKAN_1_2'}:
                                continue
++                      # skip cases that have const pNext pointer
++                      if sType == 'RASTERIZATION_ORDER_ATTACHMENT_ACCESS':
++                              continue
                        # end handling special cases
                        ptrnExtensionName       = r'^\s*#define\s+(\w+' + sSuffix + '_' + sType + '_EXTENSION_NAME).+$'
                        matchExtensionName      = re.search(ptrnExtensionName, src, re.M)
@@@ -1929,16 -1932,14 +1936,12 @@@ def generateDevicePropertiesDefs(src)
                matchStructName         = re.search(ptrnStructName, src, re.M)
                if matchStructName:
                        extType = sType
--                      if extType == "MAINTENANCE_3":
--                              extType = "MAINTENANCE3"
-                       elif extType == "MAINTENANCE_4":
-                               extType = "MAINTENANCE4"
--                      elif extType == "DISCARD_RECTANGLE":
++                      if extType == "DISCARD_RECTANGLE":
                                extType = "DISCARD_RECTANGLES"
                        elif extType == "DRIVER":
                                extType = "DRIVER_PROPERTIES"
                        elif extType == "POINT_CLIPPING":
--                              extType = "MAINTENANCE2"
++                              extType = "MAINTENANCE_2"
                        elif extType == "SHADER_CORE":
                                extType = "SHADER_CORE_PROPERTIES"
                        elif extType == "DRM":
@@@ -2442,51 -2436,52 +2474,53 @@@ if __name__ == "__main__"
        deviceFuncs             = [Function.TYPE_DEVICE]
  
        dfd                                                                             = generateDeviceFeaturesDefs(src)
-       writeDeviceFeatures                                             (api, dfd, os.path.join(VULKAN_DIR, "vkDeviceFeatures.inl"))
-       writeDeviceFeaturesDefaultDeviceDefs    (dfd, os.path.join(VULKAN_DIR, "vkDeviceFeaturesForDefaultDeviceDefs.inl"))
-       writeDeviceFeaturesContextDecl                  (dfd, os.path.join(VULKAN_DIR, "vkDeviceFeaturesForContextDecl.inl"))
-       writeDeviceFeaturesContextDefs                  (dfd, os.path.join(VULKAN_DIR, "vkDeviceFeaturesForContextDefs.inl"))
-       writeDeviceFeatureTest                                  (api, os.path.join(VULKAN_DIR, "vkDeviceFeatureTest.inl"))
+       writeDeviceFeatures                                             (api, dfd, os.path.join(outputPath, "vkDeviceFeatures.inl"))
+       writeDeviceFeaturesDefaultDeviceDefs    (dfd, os.path.join(outputPath, "vkDeviceFeaturesForDefaultDeviceDefs.inl"))
+       writeDeviceFeaturesContextDecl                  (dfd, os.path.join(outputPath, "vkDeviceFeaturesForContextDecl.inl"))
+       writeDeviceFeaturesContextDefs                  (dfd, os.path.join(outputPath, "vkDeviceFeaturesForContextDefs.inl"))
++      writeDeviceFeatureTest                                  (api, os.path.join(outputPath, "vkDeviceFeatureTest.inl"))
  
        dpd                                                                             = generateDevicePropertiesDefs(src)
-       writeDeviceProperties                                   (api, dpd, os.path.join(VULKAN_DIR, "vkDeviceProperties.inl"))
-       writeDevicePropertiesDefaultDeviceDefs  (dpd, os.path.join(VULKAN_DIR, "vkDevicePropertiesForDefaultDeviceDefs.inl"))
-       writeDevicePropertiesContextDecl                (dpd, os.path.join(VULKAN_DIR, "vkDevicePropertiesForContextDecl.inl"))
-       writeDevicePropertiesContextDefs                (dpd, os.path.join(VULKAN_DIR, "vkDevicePropertiesForContextDefs.inl"))
-       writeHandleType                                                 (api, os.path.join(VULKAN_DIR, "vkHandleType.inl"))
-       writeBasicTypes                                                 (api, os.path.join(VULKAN_DIR, "vkBasicTypes.inl"))
-       writeCompositeTypes                                             (api, os.path.join(VULKAN_DIR, "vkStructTypes.inl"))
-       writeInterfaceDecl                                              (api, os.path.join(VULKAN_DIR, "vkVirtualPlatformInterface.inl"),               platformFuncs,  False)
-       writeInterfaceDecl                                              (api, os.path.join(VULKAN_DIR, "vkVirtualInstanceInterface.inl"),               instanceFuncs,  False)
-       writeInterfaceDecl                                              (api, os.path.join(VULKAN_DIR, "vkVirtualDeviceInterface.inl"),                 deviceFuncs,    False)
-       writeInterfaceDecl                                              (api, os.path.join(VULKAN_DIR, "vkConcretePlatformInterface.inl"),              platformFuncs,  True)
-       writeInterfaceDecl                                              (api, os.path.join(VULKAN_DIR, "vkConcreteInstanceInterface.inl"),              instanceFuncs,  True)
-       writeInterfaceDecl                                              (api, os.path.join(VULKAN_DIR, "vkConcreteDeviceInterface.inl"),                deviceFuncs,    True)
-       writeFunctionPtrTypes                                   (api, os.path.join(VULKAN_DIR, "vkFunctionPointerTypes.inl"))
-       writeFunctionPointers                                   (api, os.path.join(VULKAN_DIR, "vkPlatformFunctionPointers.inl"),               platformFuncs)
-       writeFunctionPointers                                   (api, os.path.join(VULKAN_DIR, "vkInstanceFunctionPointers.inl"),               instanceFuncs)
-       writeFunctionPointers                                   (api, os.path.join(VULKAN_DIR, "vkDeviceFunctionPointers.inl"),                 deviceFuncs)
-       writeInitFunctionPointers                               (api, os.path.join(VULKAN_DIR, "vkInitPlatformFunctionPointers.inl"),   platformFuncs,  lambda f: f.name != "vkGetInstanceProcAddr")
-       writeInitFunctionPointers                               (api, os.path.join(VULKAN_DIR, "vkInitInstanceFunctionPointers.inl"),   instanceFuncs)
-       writeInitFunctionPointers                               (api, os.path.join(VULKAN_DIR, "vkInitDeviceFunctionPointers.inl"),             deviceFuncs)
-       writeFuncPtrInterfaceImpl                               (api, os.path.join(VULKAN_DIR, "vkPlatformDriverImpl.inl"),                             platformFuncs,  "PlatformDriver")
-       writeFuncPtrInterfaceImpl                               (api, os.path.join(VULKAN_DIR, "vkInstanceDriverImpl.inl"),                             instanceFuncs,  "InstanceDriver")
-       writeFuncPtrInterfaceImpl                               (api, os.path.join(VULKAN_DIR, "vkDeviceDriverImpl.inl"),                               deviceFuncs,    "DeviceDriver")
-       writeStrUtilProto                                               (api, os.path.join(VULKAN_DIR, "vkStrUtil.inl"))
-       writeStrUtilImpl                                                (api, os.path.join(VULKAN_DIR, "vkStrUtilImpl.inl"))
-       writeRefUtilProto                                               (api, os.path.join(VULKAN_DIR, "vkRefUtil.inl"))
-       writeRefUtilImpl                                                (api, os.path.join(VULKAN_DIR, "vkRefUtilImpl.inl"))
-       writeStructTraitsImpl                                   (api, os.path.join(VULKAN_DIR, "vkGetStructureTypeImpl.inl"))
-       writeNullDriverImpl                                             (api, os.path.join(VULKAN_DIR, "vkNullDriverImpl.inl"))
-       writeTypeUtil                                                   (api, os.path.join(VULKAN_DIR, "vkTypeUtil.inl"))
-       writeSupportedExtenions                                 (api, os.path.join(VULKAN_DIR, "vkSupportedExtensions.inl"))
-       writeCoreFunctionalities                                (api, os.path.join(VULKAN_DIR, "vkCoreFunctionalities.inl"))
-       writeExtensionFunctions                                 (api, os.path.join(VULKAN_DIR, "vkExtensionFunctions.inl"))
-       writeDeviceFeatures2                                    (api, os.path.join(VULKAN_DIR, "vkDeviceFeatures2.inl"))
-       writeMandatoryFeatures                                  (     os.path.join(VULKAN_DIR, "vkMandatoryFeatures.inl"))
-       writeExtensionList                                              (     os.path.join(VULKAN_DIR, "vkInstanceExtensions.inl"),                             'INSTANCE')
-       writeExtensionList                                              (     os.path.join(VULKAN_DIR, "vkDeviceExtensions.inl"),                               'DEVICE')
-       writeDriverIds                                                  (     os.path.join(VULKAN_DIR, "vkKnownDriverIds.inl"))
-       writeObjTypeImpl                                                (api, os.path.join(VULKAN_DIR, "vkObjTypeImpl.inl"))
+       writeDeviceProperties                                   (api, dpd, os.path.join(outputPath, "vkDeviceProperties.inl"))
+       writeDevicePropertiesDefaultDeviceDefs  (dpd, os.path.join(outputPath, "vkDevicePropertiesForDefaultDeviceDefs.inl"))
+       writeDevicePropertiesContextDecl                (dpd, os.path.join(outputPath, "vkDevicePropertiesForContextDecl.inl"))
+       writeDevicePropertiesContextDefs                (dpd, os.path.join(outputPath, "vkDevicePropertiesForContextDefs.inl"))
+       writeHandleType                                                 (api, os.path.join(outputPath, "vkHandleType.inl"))
+       writeBasicTypes                                                 (api, os.path.join(outputPath, "vkBasicTypes.inl"))
+       writeCompositeTypes                                             (api, os.path.join(outputPath, "vkStructTypes.inl"))
+       writeInterfaceDecl                                              (api, os.path.join(outputPath, "vkVirtualPlatformInterface.inl"),               platformFuncs,  False)
+       writeInterfaceDecl                                              (api, os.path.join(outputPath, "vkVirtualInstanceInterface.inl"),               instanceFuncs,  False)
+       writeInterfaceDecl                                              (api, os.path.join(outputPath, "vkVirtualDeviceInterface.inl"),                 deviceFuncs,    False)
+       writeInterfaceDecl                                              (api, os.path.join(outputPath, "vkConcretePlatformInterface.inl"),              platformFuncs,  True)
+       writeInterfaceDecl                                              (api, os.path.join(outputPath, "vkConcreteInstanceInterface.inl"),              instanceFuncs,  True)
+       writeInterfaceDecl                                              (api, os.path.join(outputPath, "vkConcreteDeviceInterface.inl"),                deviceFuncs,    True)
+       writeFunctionPtrTypes                                   (api, os.path.join(outputPath, "vkFunctionPointerTypes.inl"))
+       writeFunctionPointers                                   (api, os.path.join(outputPath, "vkPlatformFunctionPointers.inl"),               platformFuncs)
+       writeFunctionPointers                                   (api, os.path.join(outputPath, "vkInstanceFunctionPointers.inl"),               instanceFuncs)
+       writeFunctionPointers                                   (api, os.path.join(outputPath, "vkDeviceFunctionPointers.inl"),                 deviceFuncs)
+       writeInitFunctionPointers                               (api, os.path.join(outputPath, "vkInitPlatformFunctionPointers.inl"),   platformFuncs,  lambda f: f.name != "vkGetInstanceProcAddr")
+       writeInitFunctionPointers                               (api, os.path.join(outputPath, "vkInitInstanceFunctionPointers.inl"),   instanceFuncs)
+       writeInitFunctionPointers                               (api, os.path.join(outputPath, "vkInitDeviceFunctionPointers.inl"),             deviceFuncs)
+       writeFuncPtrInterfaceImpl                               (api, os.path.join(outputPath, "vkPlatformDriverImpl.inl"),                             platformFuncs,  "PlatformDriver")
+       writeFuncPtrInterfaceImpl                               (api, os.path.join(outputPath, "vkInstanceDriverImpl.inl"),                             instanceFuncs,  "InstanceDriver")
+       writeFuncPtrInterfaceImpl                               (api, os.path.join(outputPath, "vkDeviceDriverImpl.inl"),                               deviceFuncs,    "DeviceDriver")
+       writeStrUtilProto                                               (api, os.path.join(outputPath, "vkStrUtil.inl"))
+       writeStrUtilImpl                                                (api, os.path.join(outputPath, "vkStrUtilImpl.inl"))
+       writeRefUtilProto                                               (api, os.path.join(outputPath, "vkRefUtil.inl"))
+       writeRefUtilImpl                                                (api, os.path.join(outputPath, "vkRefUtilImpl.inl"))
+       writeStructTraitsImpl                                   (api, os.path.join(outputPath, "vkGetStructureTypeImpl.inl"))
+       writeNullDriverImpl                                             (api, os.path.join(outputPath, "vkNullDriverImpl.inl"))
+       writeTypeUtil                                                   (api, os.path.join(outputPath, "vkTypeUtil.inl"))
+       writeSupportedExtenions                                 (api, os.path.join(outputPath, "vkSupportedExtensions.inl"))
+       writeCoreFunctionalities                                (api, os.path.join(outputPath, "vkCoreFunctionalities.inl"))
+       writeExtensionFunctions                                 (api, os.path.join(outputPath, "vkExtensionFunctions.inl"))
+       writeDeviceFeatures2                                    (api, os.path.join(outputPath, "vkDeviceFeatures2.inl"))
+       writeMandatoryFeatures                                  (     os.path.join(outputPath, "vkMandatoryFeatures.inl"))
+       writeExtensionList                                              (     os.path.join(outputPath, "vkInstanceExtensions.inl"),                             'INSTANCE')
+       writeExtensionList                                              (     os.path.join(outputPath, "vkDeviceExtensions.inl"),                               'DEVICE')
+       writeDriverIds                                                  (     os.path.join(outputPath, "vkKnownDriverIds.inl"))
+       writeObjTypeImpl                                                (api, os.path.join(outputPath, "vkObjTypeImpl.inl"))
+       # NOTE: when new files are generated then they should also be added to the
+       # vk-gl-cts\external\vulkancts\framework\vulkan\CMakeLists.txt outputs list
index 6e0b5cc5450acd17c0e968cb0c2f0ca2f63bfb43,aa90f7f3434bb1f4d0adf636d5053d9923cfd33d..91893b902ab6091f4ae56c9853d4ea99ecf9e095
@@@ -568,10 -551,9 +551,9 @@@ class ContextRese
  {
  public:
                                                ContextReset                            (glw::Functions& gl, tcu::TestLog& log, FixedFunctionType fixedFunctionType);
-                                               ContextReset                            (glw::Functions& gl, tcu::TestLog& log, ShaderType shaderType);
                                                ContextReset                            (glw::Functions& gl, tcu::TestLog& log, ShaderType shaderType, ResourceType resourceType, ReadWriteType readWriteType);
  
 -      virtual                         ~ContextReset                           (void) {};
 +      virtual                         ~ContextReset                           (void) {}
  
        virtual void            setup                                           (void) = 0;
        virtual void            draw                                            (void) = 0;