Merge "Improve VK_MAKE_VERSION and VK_BIT macros" into nyc-dev
authorPyry Haulos <phaulos@google.com>
Mon, 11 Apr 2016 16:19:59 +0000 (16:19 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 11 Apr 2016 16:19:59 +0000 (16:19 +0000)
external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp
external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateBaseClass.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp
external/vulkancts/modules/vulkan/image/vktImageAtomicOperationTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.hpp
external/vulkancts/modules/vulkan/vktSynchronization.cpp
external/vulkancts/mustpass/1.0.0/src/test-issues.txt
external/vulkancts/mustpass/1.0.0/vk-default.txt

index c6bf21f..af62019 100644 (file)
@@ -1756,8 +1756,8 @@ tcu::TestStatus imageFormatProperties (Context& context, ImageFormatPropertyCase
 
                                // Specification requires that all fields are set to 0
                                results.check(properties.maxExtent.width        == 0, "maxExtent.width != 0");
-                               results.check(properties.maxExtent.height       == 0, "maxExtent.width != 0");
-                               results.check(properties.maxExtent.depth        == 0, "maxExtent.width != 0");
+                               results.check(properties.maxExtent.height       == 0, "maxExtent.height != 0");
+                               results.check(properties.maxExtent.depth        == 0, "maxExtent.depth != 0");
                                results.check(properties.maxMipLevels           == 0, "maxMipLevels != 0");
                                results.check(properties.maxArrayLayers         == 0, "maxArrayLayers != 0");
                                results.check(properties.sampleCounts           == 0, "sampleCounts != 0");
index d48b7d6..27c1bfb 100644 (file)
 #include "vkDeviceUtil.hpp"
 #include "vkPrograms.hpp"
 #include "vkTypeUtil.hpp"
+#include "vkImageUtil.hpp"
 
 #include "tcuTestLog.hpp"
 #include "tcuFormatUtil.hpp"
+#include "tcuTextureUtil.hpp"
+#include "tcuImageCompare.hpp"
+
+#include "rrRenderer.hpp"
 
 #include "deUniquePtr.hpp"
 
@@ -188,6 +193,69 @@ void createTriangleProgs (SourceCollections& dst)
                "void main (void) { o_color = vec4(1.0, 0.0, 1.0, 1.0); }\n");
 }
 
+class RefVertexShader : public rr::VertexShader
+{
+public:
+       RefVertexShader (void)
+               : rr::VertexShader(1, 0)
+       {
+               m_inputs[0].type = rr::GENERICVECTYPE_FLOAT;
+       }
+
+       void shadeVertices (const rr::VertexAttrib* inputs, rr::VertexPacket* const* packets, const int numPackets) const
+       {
+               for (int packetNdx = 0; packetNdx < numPackets; ++packetNdx)
+               {
+                       packets[packetNdx]->position = rr::readVertexAttribFloat(inputs[0],
+                                                                                                                                        packets[packetNdx]->instanceNdx,
+                                                                                                                                        packets[packetNdx]->vertexNdx);
+               }
+       }
+};
+
+class RefFragmentShader : public rr::FragmentShader
+{
+public:
+       RefFragmentShader (void)
+               : rr::FragmentShader(0, 1)
+       {
+               m_outputs[0].type = rr::GENERICVECTYPE_FLOAT;
+       }
+
+       void shadeFragments (rr::FragmentPacket*, const int numPackets, const rr::FragmentShadingContext& context) const
+       {
+               for (int packetNdx = 0; packetNdx < numPackets; ++packetNdx)
+               {
+                       for (int fragNdx = 0; fragNdx < rr::NUM_FRAGMENTS_PER_PACKET; ++fragNdx)
+                       {
+                               rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, tcu::Vec4(1.0f, 0.0f, 1.0f, 1.0f));
+                       }
+               }
+       }
+};
+
+void renderReferenceTriangle (const tcu::PixelBufferAccess& dst, const tcu::Vec4 (&vertices)[3])
+{
+       const RefVertexShader                                   vertShader;
+       const RefFragmentShader                                 fragShader;
+       const rr::Program                                               program                 (&vertShader, &fragShader);
+       const rr::MultisamplePixelBufferAccess  colorBuffer             = rr::MultisamplePixelBufferAccess::fromSinglesampleAccess(dst);
+       const rr::RenderTarget                                  renderTarget    (colorBuffer);
+       const rr::RenderState                                   renderState             ((rr::ViewportState(colorBuffer)));
+       const rr::Renderer                                              renderer;
+       const rr::VertexAttrib                                  vertexAttribs[] =
+       {
+               rr::VertexAttrib(rr::VERTEXATTRIBTYPE_FLOAT, 4, sizeof(tcu::Vec4), 0, vertices[0].getPtr())
+       };
+
+       renderer.draw(rr::DrawCommand(renderState,
+                                                                 renderTarget,
+                                                                 program,
+                                                                 DE_LENGTH_OF_ARRAY(vertexAttribs),
+                                                                 &vertexAttribs[0],
+                                                                 rr::PrimitiveList(rr::PRIMITIVETYPE_TRIANGLES, DE_LENGTH_OF_ARRAY(vertices), 0)));
+}
+
 tcu::TestStatus renderTriangleTest (Context& context)
 {
        const VkDevice                                                  vkDevice                                = context.getDevice();
@@ -196,6 +264,8 @@ tcu::TestStatus renderTriangleTest (Context& context)
        const deUint32                                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
        SimpleAllocator                                                 memAlloc                                (vk, vkDevice, getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), context.getPhysicalDevice()));
        const tcu::IVec2                                                renderSize                              (256, 256);
+       const VkFormat                                                  colorFormat                             = VK_FORMAT_R8G8B8A8_UNORM;
+       const tcu::Vec4                                                 clearColor                              (0.125f, 0.25f, 0.75f, 1.0f);
 
        const tcu::Vec4                                                 vertices[]                              =
        {
@@ -624,7 +694,10 @@ tcu::TestStatus renderTriangleTest (Context& context)
        }
 
        {
-               const VkClearValue                      clearValue              = makeClearValueColorF32(0.125f, 0.25f, 0.75f, 1.0f);
+               const VkClearValue                      clearValue              = makeClearValueColorF32(clearColor[0],
+                                                                                                                                                        clearColor[1],
+                                                                                                                                                        clearColor[2],
+                                                                                                                                                        clearColor[3]);
                const VkRenderPassBeginInfo     passBeginParams =
                {
                        VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,                       // sType
@@ -754,9 +827,10 @@ tcu::TestStatus renderTriangleTest (Context& context)
                VK_CHECK(vk.waitForFences(vkDevice, 1u, &fence.get(), DE_TRUE, ~0ull));
        }
 
-       // Log image
+       // Read results, render reference, compare
        {
-               const VkMappedMemoryRange       range           =
+               const tcu::TextureFormat                        tcuFormat               = vk::mapVkFormat(colorFormat);
+               const VkMappedMemoryRange                       range                   =
                {
                        VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,  // sType
                        DE_NULL,                                                                // pNext
@@ -764,10 +838,31 @@ tcu::TestStatus renderTriangleTest (Context& context)
                        0,                                                                              // offset
                        imageSizeBytes,                                                 // size
                };
-               void*                                           imagePtr        = readImageBufferMemory->getHostPtr();
+               const tcu::ConstPixelBufferAccess       resultAccess    (tcuFormat, renderSize.x(), renderSize.y(), 1, readImageBufferMemory->getHostPtr());
 
                VK_CHECK(vk.invalidateMappedMemoryRanges(vkDevice, 1u, &range));
-               context.getTestContext().getLog() << TestLog::Image("Result", "Result", tcu::ConstPixelBufferAccess(tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), renderSize.x(), renderSize.y(), 1, imagePtr));
+
+               {
+                       tcu::TextureLevel       refImage                (tcuFormat, renderSize.x(), renderSize.y());
+                       const tcu::UVec4        threshold               (0u);
+                       const tcu::IVec3        posDeviation    (1,1,0);
+
+                       tcu::clear(refImage.getAccess(), clearColor);
+                       renderReferenceTriangle(refImage.getAccess(), vertices);
+
+                       if (tcu::intThresholdPositionDeviationCompare(context.getTestContext().getLog(),
+                                                                                                                 "ComparisonResult",
+                                                                                                                 "Image comparison result",
+                                                                                                                 refImage.getAccess(),
+                                                                                                                 resultAccess,
+                                                                                                                 threshold,
+                                                                                                                 posDeviation,
+                                                                                                                 false,
+                                                                                                                 tcu::COMPARE_LOG_RESULT))
+                               return tcu::TestStatus::pass("Rendering succeeded");
+                       else
+                               return tcu::TestStatus::fail("Image comparison failed");
+               }
        }
 
        return tcu::TestStatus::pass("Rendering succeeded");
index 7e18d9e..00623a5 100644 (file)
@@ -198,6 +198,18 @@ void DrawTestsBaseClass::beginRenderPass (void)
        m_vk.cmdClearColorImage(*m_cmdBuffer, m_colorTargetImage->object(),
                vk::VK_IMAGE_LAYOUT_GENERAL, &clearColor, 1, &subresourceRange);
 
+       const vk::VkMemoryBarrier memBarrier =
+       {
+               vk::VK_STRUCTURE_TYPE_MEMORY_BARRIER,
+               DE_NULL,
+               vk::VK_ACCESS_TRANSFER_WRITE_BIT,
+               vk::VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
+       };
+
+       m_vk.cmdPipelineBarrier(*m_cmdBuffer, vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+               vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+               0, 1, &memBarrier, 0, DE_NULL, 0, DE_NULL);
+
        const vk::VkRect2D renderArea = { { 0, 0 }, { WIDTH, HEIGHT } };
        const RenderPassBeginInfo renderPassBegin(*m_renderPass, *m_framebuffer, renderArea);
 
index 53f61ee..530a32b 100644 (file)
@@ -199,6 +199,18 @@ void DynamicStateBaseClass::beginRenderPassWithClearColor (const vk::VkClearColo
        m_vk.cmdClearColorImage(*m_cmdBuffer, m_colorTargetImage->object(),
                vk::VK_IMAGE_LAYOUT_GENERAL, &clearColor, 1, &subresourceRange);
 
+       const vk::VkMemoryBarrier memBarrier =
+       {
+               vk::VK_STRUCTURE_TYPE_MEMORY_BARRIER,
+               DE_NULL,
+               vk::VK_ACCESS_TRANSFER_WRITE_BIT,
+               vk::VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
+       };
+
+       m_vk.cmdPipelineBarrier(*m_cmdBuffer, vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+               vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+               0, 1, &memBarrier, 0, DE_NULL, 0, DE_NULL);
+
        const vk::VkRect2D renderArea = { { 0, 0 }, { WIDTH, HEIGHT } };
        const RenderPassBeginInfo renderPassBegin(*m_renderPass, *m_framebuffer, renderArea);
 
index 5012614..903a2eb 100644 (file)
@@ -295,6 +295,20 @@ protected:
                m_vk.cmdClearDepthStencilImage(*m_cmdBuffer, m_depthStencilImage->object(),
                                                                           vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &depthStencilClearValue, 2, subresourceRangeDepthStencil);
 
+               const vk::VkMemoryBarrier memBarrier =
+               {
+                       vk::VK_STRUCTURE_TYPE_MEMORY_BARRIER,
+                       DE_NULL,
+                       vk::VK_ACCESS_TRANSFER_WRITE_BIT,
+                       vk::VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
+                               vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT
+               };
+
+               m_vk.cmdPipelineBarrier(*m_cmdBuffer, vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+                       vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT |
+                       vk::VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | vk::VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
+                       0, 1, &memBarrier, 0, DE_NULL, 0, DE_NULL);
+
                const vk::VkRect2D renderArea = { { 0, 0 }, { WIDTH, HEIGHT } };
                const RenderPassBeginInfo renderPassBegin(*m_renderPass, *m_framebuffer, renderArea);
 
index 46c8196..4d1c3eb 100644 (file)
@@ -749,7 +749,9 @@ void BinaryAtomicIntermValuesInstance::prepareResources (void)
        Allocator&                              allocator               = m_context.getDefaultAllocator();
 
        const UVec3 layerSize                   = getLayerSize(m_imageType, m_imageSize);
-       const UVec3 extendedLayerSize   = UVec3(NUM_INVOCATIONS_PER_PIXEL * layerSize.x(), layerSize.y(), layerSize.z());
+       const bool  isCubeBasedImage    = (m_imageType == IMAGE_TYPE_CUBE || m_imageType == IMAGE_TYPE_CUBE_ARRAY);
+       const UVec3 extendedLayerSize   = isCubeBasedImage      ? UVec3(NUM_INVOCATIONS_PER_PIXEL * layerSize.x(), NUM_INVOCATIONS_PER_PIXEL * layerSize.y(), layerSize.z())
+                                                                                                               : UVec3(NUM_INVOCATIONS_PER_PIXEL * layerSize.x(), layerSize.y(), layerSize.z());
 
        const VkImageCreateInfo imageParams =
        {
index 53637cc..166b5e8 100644 (file)
@@ -340,6 +340,7 @@ ImageSamplingInstance::ImageSamplingInstance (Context&                                                      context,
                                                                                          const std::vector<Vertex4Tex4>&       vertices)
        : vkt::TestInstance             (context)
        , m_imageViewType               (imageViewType)
+       , m_imageFormat                 (imageFormat)
        , m_imageSize                   (imageSize)
        , m_layerCount                  (layerCount)
        , m_componentMapping    (componentMapping)
@@ -979,13 +980,17 @@ tcu::TestStatus ImageSamplingInstance::verifyImage (void)
                const deUint32                          queueFamilyIndex                        = m_context.getUniversalQueueFamilyIndex();
                SimpleAllocator                         memAlloc                                        (vk, vkDevice, getPhysicalDeviceMemoryProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice()));
                MovePtr<tcu::TextureLevel>      result                                          = readColorAttachment(vk, vkDevice, queue, queueFamilyIndex, memAlloc, *m_colorImage, m_colorFormat, m_renderSize);
+               tcu::UVec4                                      threshold                                       = tcu::UVec4(4, 4, 4, 4);
+
+               if ((m_imageFormat == vk::VK_FORMAT_EAC_R11G11_SNORM_BLOCK) || (m_imageFormat == vk::VK_FORMAT_EAC_R11_SNORM_BLOCK))
+                       threshold = tcu::UVec4(8, 8, 8, 8);
 
                compareOk = tcu::intThresholdPositionDeviationCompare(m_context.getTestContext().getLog(),
                                                                                                                          "IntImageCompare",
                                                                                                                          "Image comparison",
                                                                                                                          refRenderer->getAccess(),
                                                                                                                          result->getAccess(),
-                                                                                                                         tcu::UVec4(4, 4, 4, 4),
+                                                                                                                         threshold,
                                                                                                                          tcu::IVec3(1, 1, 0),
                                                                                                                          true,
                                                                                                                          tcu::COMPARE_LOG_RESULT);
index f3ce713..32a47c8 100644 (file)
@@ -62,6 +62,7 @@ protected:
 
 private:
        const vk::VkImageViewType                                       m_imageViewType;
+       const vk::VkFormat                                                      m_imageFormat;
        const tcu::IVec3                                                        m_imageSize;
        const int                                                                       m_layerCount;
 
index 7e7a9fe..2b60a8f 100644 (file)
@@ -81,22 +81,32 @@ void buildShaders (SourceCollections& shaderCollection)
                                "}\n");
 }
 
-Move<VkDevice> createTestDevice (const InstanceInterface& vki, VkPhysicalDevice physicalDevice)
+Move<VkDevice> createTestDevice (const InstanceInterface& vki, VkPhysicalDevice physicalDevice, deUint32 *outQueueFamilyIndex)
 {
        VkDeviceQueueCreateInfo         queueInfo;
        VkDeviceCreateInfo                      deviceInfo;
        size_t                                          queueNdx;
        const float                                     queuePriority   = 1.0f;
+       const deUint32                          queueCount              = 2u;
 
        const vector<VkQueueFamilyProperties>   queueProps                              = getPhysicalDeviceQueueFamilyProperties(vki, physicalDevice);
        const VkPhysicalDeviceFeatures                  physicalDeviceFeatures  = getPhysicalDeviceFeatures(vki, physicalDevice);
 
        for (queueNdx = 0; queueNdx < queueProps.size(); queueNdx++)
        {
-               if ((queueProps[queueNdx].queueFlags & VK_QUEUE_GRAPHICS_BIT) == VK_QUEUE_GRAPHICS_BIT)
+               if ((queueProps[queueNdx].queueFlags & VK_QUEUE_GRAPHICS_BIT) == VK_QUEUE_GRAPHICS_BIT && (queueProps[queueNdx].queueCount >= queueCount))
                        break;
        }
 
+       if (queueNdx >= queueProps.size())
+       {
+               // No queue family index found
+               std::ostringstream msg;
+               msg << "Cannot create device with " << queueCount << " graphics queues";
+
+               throw tcu::NotSupportedError(msg.str());
+       }
+
        deMemset(&queueInfo,    0, sizeof(queueInfo));
        deMemset(&deviceInfo,   0, sizeof(deviceInfo));
 
@@ -104,7 +114,7 @@ Move<VkDevice> createTestDevice (const InstanceInterface& vki, VkPhysicalDevice
        queueInfo.pNext                                                 = DE_NULL;
        queueInfo.flags                                                 = (VkDeviceQueueCreateFlags)0u;
        queueInfo.queueFamilyIndex                              = (deUint32)queueNdx;
-       queueInfo.queueCount                                    = 2u;
+       queueInfo.queueCount                                    = queueCount;
        queueInfo.pQueuePriorities                              = &queuePriority;
 
        deviceInfo.sType                                                = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
@@ -117,6 +127,8 @@ Move<VkDevice> createTestDevice (const InstanceInterface& vki, VkPhysicalDevice
        deviceInfo.ppEnabledLayerNames                  = DE_NULL;
        deviceInfo.pEnabledFeatures                             = &physicalDeviceFeatures;
 
+       *outQueueFamilyIndex                                    = queueInfo.queueFamilyIndex;
+
        return createDevice(vki, physicalDevice, &deviceInfo);
 };
 
@@ -314,7 +326,7 @@ void createVulkanImage (const ImageParameters& imageParameters, Image& image, Me
                imageViewCreateInfo.pNext                               = DE_NULL;
                imageViewCreateInfo.flags                               = 0;
                imageViewCreateInfo.image                               = image.image.get();
-               imageViewCreateInfo.viewType                    = VK_IMAGE_VIEW_TYPE_3D;
+               imageViewCreateInfo.viewType                    = VK_IMAGE_VIEW_TYPE_2D;
                imageViewCreateInfo.format                              = imageParameters.format;
                imageViewCreateInfo.components                  = componentMap;
                imageViewCreateInfo.subresourceRange    = subresourceRange;
@@ -498,7 +510,7 @@ void createCommandBuffer (Context& context, const VkDevice device, const deUint3
        commandBufferInfo.commandBufferCount    = 1;
 
        VK_CHECK(deviceInterface.allocateCommandBuffers(device, &commandBufferInfo, &commandBuffer));
-       *commandBufferRef = vk::Move<VkCommandBuffer>(vk::check<VkCommandBuffer>(commandBuffer), Deleter<VkCommandBuffer>(deviceInterface, device, DE_NULL));
+       *commandBufferRef = vk::Move<VkCommandBuffer>(vk::check<VkCommandBuffer>(commandBuffer), Deleter<VkCommandBuffer>(deviceInterface, device, commandPool));
 }
 
 void createFences (const DeviceInterface& deviceInterface, VkDevice device, bool signaled, deUint32 numFences, VkFence* fence)
@@ -663,7 +675,7 @@ struct TestContext
                , setEvent              (DE_FALSE)
                , waitEvent             (DE_FALSE)
        {
-               createFences(context.getDeviceInterface(), device, DE_NULL, DE_LENGTH_OF_ARRAY(fences), fences);
+               createFences(context.getDeviceInterface(), device, false, DE_LENGTH_OF_ARRAY(fences), fences);
        }
 
        ~TestContext()
@@ -972,7 +984,7 @@ void generateWork (TestContext& testContext)
        bufferBarriers.resize(0);
        imageBarriers.resize(0);
 
-       transferInfo.context = &testContext.context;
+       transferInfo.context                    = &testContext.context;
        transferInfo.commandBuffer              = renderInfo.commandBuffer;
        transferInfo.width                              = testContext.renderDimension.x();
        transferInfo.height                             = testContext.renderDimension.y();
@@ -1020,14 +1032,12 @@ tcu::TestStatus testFences (Context& context)
 {
        TestLog&                                        log                                     = context.getTestContext().getLog();
        const DeviceInterface&          deviceInterface         = context.getDeviceInterface();
-       const InstanceInterface&        instanceInterface       = context.getInstanceInterface();
-       const VkPhysicalDevice          physicalDevice          = context.getPhysicalDevice();
        const VkQueue                           queue                           = context.getUniversalQueue();
        const deUint32                          queueFamilyIdx          = context.getUniversalQueueFamilyIndex();
-       vk::Move<VkDevice>                      device                          = createTestDevice(instanceInterface, physicalDevice);
+       VkDevice                                        device                          = context.getDevice();
        VkResult                                        testStatus;
        VkResult                                        fenceStatus;
-       TestContext                                     testContext(context, device.get());
+       TestContext                                     testContext(context, device);
        VkSubmitInfo                            submitInfo;
        VkMappedMemoryRange                     range;
        void*                                           resultImage;
@@ -1044,29 +1054,38 @@ tcu::TestStatus testFences (Context& context)
        testContext.renderDimension = tcu::IVec2(256, 256);
        testContext.renderSize = sizeof(deUint32) * testContext.renderDimension.x() * testContext.renderDimension.y();
 
-       createCommandBuffer(testContext.context, device.get(), queueFamilyIdx, &testContext.cmdBuffer);
+       createCommandBuffer(testContext.context, device, queueFamilyIdx, &testContext.cmdBuffer);
        generateWork(testContext);
 
        initSubmitInfo(&submitInfo, 1);
        submitInfo.pCommandBuffers              = &testContext.cmdBuffer.get();
 
-       VK_CHECK(deviceInterface.queueSubmit(queue, 1, &submitInfo, testContext.fences[0]));
-
-       fenceStatus = deviceInterface.getFenceStatus(device.get(), testContext.fences[0]);
+       // Default status is unsignaled
+       fenceStatus = deviceInterface.getFenceStatus(device, testContext.fences[0]);
        if (fenceStatus != VK_NOT_READY)
        {
-               log << TestLog::Message << "testSynchronizationPrimitives fence should be reset but status is " << fenceStatus << TestLog::EndMessage;
+               log << TestLog::Message << "testSynchronizationPrimitives fence 0 should be reset but status is " << getResultName(fenceStatus) << TestLog::EndMessage;
                return tcu::TestStatus::fail("Fence in incorrect state");
        }
+       fenceStatus = deviceInterface.getFenceStatus(device, testContext.fences[1]);
+       if (fenceStatus != VK_NOT_READY)
+       {
+               log << TestLog::Message << "testSynchronizationPrimitives fence 1 should be reset but status is " << getResultName(fenceStatus) << TestLog::EndMessage;
+               return tcu::TestStatus::fail("Fence in incorrect state");
+       }
+
+       VK_CHECK(deviceInterface.queueSubmit(queue, 1, &submitInfo, testContext.fences[0]));
 
-       testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
+       // Wait for both fences
+       testStatus  = deviceInterface.waitForFences(device, 2, &testContext.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
        if (testStatus != VK_TIMEOUT)
        {
                log << TestLog::Message << "testSynchPrimitives failed to wait for all fences" << TestLog::EndMessage;
                return tcu::TestStatus::fail("Failed to wait for mulitple fences");
        }
 
-       testStatus = deviceInterface.waitForFences(device.get(),
+       // Wait until timeout (no work has been submited to testContext.fences[1])
+       testStatus = deviceInterface.waitForFences(device,
                                                                                                1,
                                                                                                &testContext.fences[1],
                                                                                                DE_TRUE,
@@ -1078,17 +1097,20 @@ tcu::TestStatus testFences (Context& context)
                return tcu::TestStatus::fail("failed to wait for single fence");
        }
 
-       testStatus = deviceInterface.waitForFences(device.get(), 1, &testContext.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
+       // Wait for testContext.fences[0], assuming that the work can be completed
+       // in the default time + the time given so far since the queueSubmit
+       testStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
        if (testStatus != VK_SUCCESS)
        {
                log << TestLog::Message << "testSynchPrimitives failed to wait for a set fence" << TestLog::EndMessage;
                return tcu::TestStatus::fail("failed to wait for a set fence");
        }
 
-       fenceStatus = deviceInterface.getFenceStatus(device.get(), testContext.fences[0]);
+       // Check that the fence is signaled after the wait
+       fenceStatus = deviceInterface.getFenceStatus(device, testContext.fences[0]);
        if (fenceStatus != VK_SUCCESS)
        {
-               log << TestLog::Message << "testSynchronizationPrimitives fence should be signaled but status is " << fenceStatus << TestLog::EndMessage;
+               log << TestLog::Message << "testSynchronizationPrimitives fence should be signaled but status is " << getResultName(fenceStatus) << TestLog::EndMessage;
                return tcu::TestStatus::fail("Fence in incorrect state");
        }
 
@@ -1097,7 +1119,7 @@ tcu::TestStatus testFences (Context& context)
        range.memory            = testContext.renderReadBuffer->getMemory();
        range.offset            = 0;
        range.size                      = testContext.renderSize;
-       VK_CHECK(deviceInterface.invalidateMappedMemoryRanges(device.get(), 1, &range));
+       VK_CHECK(deviceInterface.invalidateMappedMemoryRanges(device, 1, &range));
        resultImage = testContext.renderReadBuffer->getHostPtr();
 
        log << TestLog::Image(  "result",
@@ -1109,7 +1131,7 @@ tcu::TestStatus testFences (Context& context)
                                                                        1,
                                                                        resultImage));
 
-       return TestStatus::pass("synchornization-fences passed");
+       return TestStatus::pass("synchronization-fences passed");
 }
 
 vk::refdetails::Checked<VkSemaphore> createSemaphore (const DeviceInterface& deviceInterface, const VkDevice& device, const VkAllocationCallbacks* allocationCallbacks)
@@ -1131,9 +1153,9 @@ tcu::TestStatus testSemaphores (Context& context)
        const DeviceInterface&          deviceInterface         = context.getDeviceInterface();
        const InstanceInterface&        instanceInterface       = context.getInstanceInterface();
        const VkPhysicalDevice          physicalDevice          = context.getPhysicalDevice();
-       vk::Move<VkDevice>                      device                          = createTestDevice(instanceInterface, physicalDevice);
+       deUint32                                        queueFamilyIdx;
+       vk::Move<VkDevice>                      device                          = createTestDevice(instanceInterface, physicalDevice, &queueFamilyIdx);
        VkQueue                                         queue[2];
-       const deUint32                          queueFamilyIdx          = context.getUniversalQueueFamilyIndex();
        VkResult                                        testStatus;
        TestContext                                     testContext1(context, device.get());
        TestContext                                     testContext2(context, device.get());
@@ -1159,15 +1181,15 @@ tcu::TestStatus testSemaphores (Context& context)
                tcu::Vec4( 0.0f, +0.5f, 0.0f, 1.0f)
        };
 
-       testContext1.vertices = vertices1;
-       testContext1.numVertices = DE_LENGTH_OF_ARRAY(vertices1);
-       testContext1.renderDimension = tcu::IVec2(256, 256);
-       testContext1.renderSize = sizeof(deUint32) * testContext1.renderDimension.x() * testContext1.renderDimension.y();
+       testContext1.vertices                   = vertices1;
+       testContext1.numVertices                = DE_LENGTH_OF_ARRAY(vertices1);
+       testContext1.renderDimension    = tcu::IVec2(256, 256);
+       testContext1.renderSize                 = sizeof(deUint32) * testContext1.renderDimension.x() * testContext1.renderDimension.y();
 
-       testContext2.vertices = vertices2;
-       testContext2.numVertices = DE_LENGTH_OF_ARRAY(vertices2);
-       testContext2.renderDimension = tcu::IVec2(256, 256);
-       testContext2.renderSize = sizeof(deUint32) * testContext2.renderDimension.x() * testContext2.renderDimension.y();
+       testContext2.vertices                   = vertices2;
+       testContext2.numVertices                = DE_LENGTH_OF_ARRAY(vertices2);
+       testContext2.renderDimension    = tcu::IVec2(256, 256);
+       testContext2.renderSize                 = sizeof(deUint32) * testContext2.renderDimension.x() * testContext2.renderDimension.y();
 
        createCommandBuffer(testContext1.context, device.get(), queueFamilyIdx, &testContext1.cmdBuffer);
        generateWork(testContext1);
@@ -1180,13 +1202,13 @@ tcu::TestStatus testSemaphores (Context& context)
        // The difference between the two submit infos is that each will use a unique cmd buffer,
        // and one will signal a semaphore but not wait on a semaphore, the other will wait on the
        // semaphore but not signal a semaphore
-       submitInfo[0].pCommandBuffers = &testContext1.cmdBuffer.get();
-       submitInfo[1].pCommandBuffers = &testContext2.cmdBuffer.get();
+       submitInfo[0].pCommandBuffers           = &testContext1.cmdBuffer.get();
+       submitInfo[1].pCommandBuffers           = &testContext2.cmdBuffer.get();
 
-       submitInfo[0].signalSemaphoreCount = 1;
-       submitInfo[0].pSignalSemaphores = &semaphore.get();
-       submitInfo[1].waitSemaphoreCount = 1;
-       submitInfo[1].pWaitSemaphores = &semaphore.get();
+       submitInfo[0].signalSemaphoreCount      = 1;
+       submitInfo[0].pSignalSemaphores         = &semaphore.get();
+       submitInfo[1].waitSemaphoreCount        = 1;
+       submitInfo[1].pWaitSemaphores           = &semaphore.get();
 
        VK_CHECK(deviceInterface.queueSubmit(queue[0], 1, &submitInfo[0], testContext1.fences[0]));
 
@@ -1262,9 +1284,9 @@ tcu::TestStatus testEvents (Context& context)
        const DeviceInterface&          deviceInterface         = context.getDeviceInterface();
        const InstanceInterface&        instanceInterface       = context.getInstanceInterface();
        const VkPhysicalDevice          physicalDevice          = context.getPhysicalDevice();
-       vk::Move<VkDevice>                      device                          = createTestDevice(instanceInterface, physicalDevice);
+       deUint32                                        queueFamilyIdx;
+       vk::Move<VkDevice>                      device                          = createTestDevice(instanceInterface, physicalDevice, &queueFamilyIdx);
        VkQueue                                         queue[2];
-       const deUint32                          queueFamilyIdx          = context.getUniversalQueueFamilyIndex();
        VkResult                                        testStatus;
        VkResult                                        eventStatus;
        TestContext                                     testContext1(context, device.get());
@@ -1318,7 +1340,7 @@ tcu::TestStatus testEvents (Context& context)
        eventStatus = deviceInterface.getEventStatus(device.get(), event.get());
        if (eventStatus != VK_EVENT_RESET)
        {
-               log << TestLog::Message << "testSynchronizationPrimitives event should be reset but status is " << eventStatus << TestLog::EndMessage;
+               log << TestLog::Message << "testSynchronizationPrimitives event should be reset but status is " << getResultName(eventStatus) << TestLog::EndMessage;
                return tcu::TestStatus::fail("Event in incorrect status");
        }
 
index a0a3563..00a155b 100644 (file)
@@ -19,3 +19,6 @@ dEQP-VK.glsl.builtin.function.common.frexp.float_highp_vertex
 dEQP-VK.glsl.builtin.function.common.frexp.vec2_highp_vertex
 dEQP-VK.glsl.builtin.function.common.frexp.vec3_highp_vertex
 dEQP-VK.glsl.builtin.function.common.frexp.vec4_highp_vertex
+
+# Issue 340: Cube map corner texel selection
+dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.mag_filter.linear
index e83c878..e1ba228 100644 (file)
@@ -43256,7 +43256,6 @@ dEQP-VK.pipeline.sampler.view_type.cube.format.r4g4b4a4_unorm_pack16.mipmap.line
 dEQP-VK.pipeline.sampler.view_type.cube.format.r4g4b4a4_unorm_pack16.mipmap.linear.lod.select_bias_3_7
 dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.min_filter.linear
 dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.min_filter.nearest
-dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.mag_filter.linear
 dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.mag_filter.nearest
 dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.mipmap.nearest.lod.equal_min_3_max_3
 dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.mipmap.nearest.lod.select_min_1