Merge branch 'spec-176-api-remove-patch-version-check' into 'vulkan-cts-1.0'
authorPyry Haulos <phaulos@google.com>
Mon, 7 Mar 2016 23:19:48 +0000 (18:19 -0500)
committerPyry Haulos <phaulos@google.com>
Mon, 7 Mar 2016 23:19:48 +0000 (18:19 -0500)
Issue 322: dEQP-VK.api.device_init.create_instance_invalid_api_version - remove patch version check

In the spirit of spec bug #176, the implementation should not emit error on unrecognized PATCH component of VkApplicationInfo.apiVersion.

This makes implementation compatible with all header patch versions that may be used by the application.

This fixes #322

See merge request !454

external/fetch_sources.py
external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp
external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp
external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp [changed mode: 0644->0755]

index efa530d..ea47fee 100644 (file)
@@ -174,7 +174,7 @@ PACKAGES = [
                "spirv-tools"),
        GitRepo(
                "https://github.com/KhronosGroup/glslang.git",
-               "5184353326ae52d63a1d7c7fccd66269aab768f7",
+               "8e3f4c2d6681eacdc9c976a59b917313f3d073fc",
                "glslang"),
 ]
 
index cd08bd1..813e8f7 100644 (file)
@@ -225,8 +225,12 @@ tcu::TestStatus allocateManyPrimaryBuffersTest(Context& context)
        };
        const Unique<VkCommandPool>                             cmdPool                                 (createCommandPool(vk, vkDevice, &cmdPoolParams));
 
-       // create a minimal amount of command buffers - is there any minimal amount in spec?
+       // \todo Determining the minimum number of command buffers should be a function of available system memory and driver capabilities.
+#if (DE_PTR_SIZE == 4)
+       const unsigned minCommandBuffer = 1024;
+#else
        const unsigned minCommandBuffer = 10000;
+#endif
 
        // Command buffer
        const VkCommandBufferAllocateInfo               cmdBufParams                    =
@@ -326,8 +330,12 @@ tcu::TestStatus allocateManySecondaryBuffersTest(Context& context)
        };
        const Unique<VkCommandPool>                             cmdPool                                 (createCommandPool(vk, vkDevice, &cmdPoolParams));
 
-       // create a minimal amount of command buffers - is there any minimal amount in spec?
+       // \todo Determining the minimum number of command buffers should be a function of available system memory and driver capabilities.
+#if (DE_PTR_SIZE == 4)
+       const unsigned minCommandBuffer = 1024;
+#else
        const unsigned minCommandBuffer = 10000;
+#endif
 
        // Command buffer
        const VkCommandBufferAllocateInfo               cmdBufParams                    =
index ba3dc12..3e709bc 100644 (file)
@@ -1861,7 +1861,12 @@ struct CommandBuffer
 
        static deUint32 getMaxConcurrent (Context&)
        {
+               // \todo Scale this based on available system memory
+#if (DE_PTR_SIZE == 4)
+               return 1024;
+#else
                return DEFAULT_MAX_CONCURRENT_OBJECTS;
+#endif
        }
 
        struct Parameters
index 32e6aa5..9fa17fe 100644 (file)
@@ -94,6 +94,46 @@ bool isDynamicDescriptorType (vk::VkDescriptorType type)
        return type == vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || type == vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC;
 }
 
+void verifyDriverSupport(const vk::VkPhysicalDeviceFeatures&   deviceFeatures,
+                                                vk::VkDescriptorType                                   descType,
+                                                vk::VkShaderStageFlags                                 activeStages)
+{
+       switch (descType)
+       {
+               case vk::VK_DESCRIPTOR_TYPE_SAMPLER:
+               case vk::VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+               case vk::VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
+               case vk::VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
+               case vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
+               case vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
+                       // These are supported in all stages
+                       return;
+
+               case vk::VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+               case vk::VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
+               case vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+               case vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
+                       if (activeStages & (vk::VK_SHADER_STAGE_VERTEX_BIT |
+                                                               vk::VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT |
+                                                               vk::VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT |
+                                                               vk::VK_SHADER_STAGE_GEOMETRY_BIT))
+                       {
+                               if (!deviceFeatures.vertexPipelineStoresAndAtomics)
+                                       TCU_THROW(NotSupportedError, (de::toString(descType) + " is not supported in the vertex pipeline").c_str());
+                       }
+
+                       if (activeStages & vk::VK_SHADER_STAGE_FRAGMENT_BIT)
+                       {
+                               if (!deviceFeatures.fragmentStoresAndAtomics)
+                                       TCU_THROW(NotSupportedError, (de::toString(descType) + " is not supported in fragment shaders").c_str());
+                       }
+                       return;
+
+               default:
+                       DE_FATAL("Impossible");
+       }
+}
+
 vk::VkImageType viewTypeToImageType (vk::VkImageViewType type)
 {
        switch (type)
@@ -2740,6 +2780,8 @@ std::string BufferDescriptorCase::genNoAccessSource (void) const
 
 vkt::TestInstance* BufferDescriptorCase::createInstance (vkt::Context& context) const
 {
+       verifyDriverSupport(context.getDeviceFeatures(), m_descriptorType, m_activeStages);
+
        if (m_exitingStages == vk::VK_SHADER_STAGE_COMPUTE_BIT)
        {
                DE_ASSERT(m_isPrimaryCmdBuf); // secondaries are only valid within renderpass
@@ -5220,6 +5262,8 @@ std::string ImageDescriptorCase::genNoAccessSource (void) const
 
 vkt::TestInstance* ImageDescriptorCase::createInstance (vkt::Context& context) const
 {
+       verifyDriverSupport(context.getDeviceFeatures(), m_descriptorType, m_activeStages);
+
        switch (m_descriptorType)
        {
                case vk::VK_DESCRIPTOR_TYPE_SAMPLER:
@@ -6099,6 +6143,8 @@ std::string TexelBufferDescriptorCase::genNoAccessSource (void) const
 
 vkt::TestInstance* TexelBufferDescriptorCase::createInstance (vkt::Context& context) const
 {
+       verifyDriverSupport(context.getDeviceFeatures(), m_descriptorType, m_activeStages);
+
        if (m_exitingStages == vk::VK_SHADER_STAGE_COMPUTE_BIT)
        {
                DE_ASSERT(m_isPrimaryCmdBuf); // secondaries are only valid within renderpass
old mode 100644 (file)
new mode 100755 (executable)
index ad3659a..c9d8c24
@@ -3835,7 +3835,9 @@ void ImageBlitFromImage::verify (VerifyContext& context, size_t)
                }
                else if (m_scale == BLIT_SCALE_20)
                {
-                       tcu::TextureLevel source (TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8), m_srcImageWidth, m_srcImageHeight);
+                       tcu::TextureLevel       source  (TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8), m_srcImageWidth, m_srcImageHeight);
+                       const float                     xscale  = ((float)m_srcImageWidth)  / (float)m_imageWidth;
+                       const float                     yscale  = ((float)m_srcImageHeight) / (float)m_imageHeight;
 
                        for (deInt32 y = 0; y < m_srcImageHeight; y++)
                        for (deInt32 x = 0; x < m_srcImageWidth; x++)
@@ -3850,7 +3852,7 @@ void ImageBlitFromImage::verify (VerifyContext& context, size_t)
 
                        for (deInt32 y = 0; y < m_imageHeight; y++)
                        for (deInt32 x = 0; x < m_imageWidth; x++)
-                               refAccess.setPixel(source.getAccess().getPixelUint(x / 2, y / 2), x, y);
+                               refAccess.setPixel(source.getAccess().getPixelUint(int(x * xscale), int(y * yscale)), x, y);
                }
                else
                        DE_FATAL("Unsupported scale");