Removed not needed reading of image
authorArkadiusz Sarwa <arkadiusz.sarwa@mobica.com>
Mon, 18 Apr 2016 08:27:34 +0000 (10:27 +0200)
committerPyry Haulos <phaulos@google.com>
Thu, 19 May 2016 21:45:10 +0000 (14:45 -0700)
(cherry picked from commit 908d6bebb1e8149a8ec877853fc4a84641923425)

external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp

index 359bfa2..4b15ecf 100644 (file)
@@ -162,30 +162,6 @@ Image::Image (const vk::DeviceInterface& vk,
 {
 }
 
-tcu::ConstPixelBufferAccess Image::readSurface (vk::VkQueue                                    queue,
-                                                                                               vk::Allocator&                          allocator,
-                                                                                               vk::VkImageLayout                       layout,
-                                                                                               vk::VkOffset3D                          offset,
-                                                                                               int                                                     width,
-                                                                                               int                                                     height,
-                                                                                               vk::VkImageAspectFlagBits       aspect,
-                                                                                               unsigned int                            mipLevel,
-                                                                                               unsigned int                            arrayElement)
-{
-       m_pixelAccessData.resize(width * height * vk::mapVkFormat(m_format).getPixelSize());
-       deMemset(m_pixelAccessData.data(), 0, m_pixelAccessData.size());
-       if (aspect == vk::VK_IMAGE_ASPECT_COLOR_BIT)
-       {
-               read(queue, allocator, layout, offset, width, height, 1, mipLevel, arrayElement, aspect, vk::VK_IMAGE_TYPE_2D,
-               m_pixelAccessData.data());
-       }
-       if (aspect == vk::VK_IMAGE_ASPECT_DEPTH_BIT || aspect == vk::VK_IMAGE_ASPECT_STENCIL_BIT)
-       {
-               readUsingBuffer(queue, allocator, layout, offset, width, height, 1, mipLevel, arrayElement, aspect, m_pixelAccessData.data());
-       }
-       return tcu::ConstPixelBufferAccess(vk::mapVkFormat(m_format), width, height, 1, m_pixelAccessData.data());
-}
-
 tcu::ConstPixelBufferAccess Image::readVolume (vk::VkQueue                                     queue,
                                                                                           vk::Allocator&                               allocator,
                                                                                           vk::VkImageLayout                    layout,
index 3ae4ba8..8e5871d 100644 (file)
@@ -69,16 +69,6 @@ public:
                                                                                                         vk::Allocator&                                                 allocator,
                                                                                                         vk::MemoryRequirement                                  memoryRequirement = vk::MemoryRequirement::Any);
 
-       tcu::ConstPixelBufferAccess readSurface                 (vk::VkQueue                                                    queue,
-                                                                                                        vk::Allocator&                                                 allocator,
-                                                                                                        vk::VkImageLayout                                              layout,
-                                                                                                        vk::VkOffset3D                                                 offset,
-                                                                                                        int                                                                    width,
-                                                                                                        int                                                                    height,
-                                                                                                        vk::VkImageAspectFlagBits                              aspect,
-                                                                                                        unsigned int                                                   mipLevel = 0,
-                                                                                                        unsigned int                                                   arrayElement = 0);
-
        tcu::ConstPixelBufferAccess readSurface1D               (vk::VkQueue                                                    queue,
                                                                                                         vk::Allocator&                                                 allocator,
                                                                                                         vk::VkImageLayout                                              layout,
index 91eaa61..22feecc 100644 (file)
@@ -492,14 +492,6 @@ tcu::TestStatus    BasicOcclusionQueryTestInstance::iterate (void)
        }
        log << tcu::TestLog::EndSection;
 
-       const vk::VkOffset3D zeroOffset = { 0, 0, 0 };
-
-       tcu::ConstPixelBufferAccess resultImageAccess = m_stateObjects->m_colorAttachmentImage->readSurface(
-                               queue, m_context.getDefaultAllocator(), vk::VK_IMAGE_LAYOUT_GENERAL,
-                               zeroOffset,  StateObjects::HEIGHT, StateObjects::WIDTH, vk::VK_IMAGE_ASPECT_COLOR_BIT);
-
-       log << tcu::TestLog::Image("Result", "Result", resultImageAccess);
-
        if (passed)
        {
                return tcu::TestStatus(QP_TEST_RESULT_PASS, "Query result verification passed");
@@ -521,7 +513,6 @@ private:
        void                                                    captureResults                                  (deUint64*                      retResults,     deUint64*               retAvailability,        bool    allowNotReady);
        void                                                    logResults                                              (const deUint64*        results,        const deUint64* availability);
        bool                                                    validateResults                                 (const deUint64*        results,        const deUint64* availability,           bool    allowUnavailable,       vk::VkPrimitiveTopology primitiveTopology);
-       void                                                    logRenderTarget                                 (void);
 
        enum
        {
@@ -702,7 +693,10 @@ tcu::TestStatus OcclusionQueryTestInstance::iterate (void)
 
        log << tcu::TestLog::EndSection;
 
-       logRenderTarget();
+       if (m_testVector.queryResultsMode != RESULTS_MODE_COPY)
+       {
+               VK_CHECK(vk.queueWaitIdle(queue));
+       }
 
                if (passed)
        {
@@ -986,18 +980,6 @@ bool OcclusionQueryTestInstance::validateResults (const deUint64* results , cons
        return passed;
 }
 
-void OcclusionQueryTestInstance::logRenderTarget (void)
-{
-       tcu::TestLog&                   log                                             = m_context.getTestContext().getLog();
-       const vk::VkQueue               queue                                   = m_context.getUniversalQueue();
-       const vk::VkOffset3D    zeroOffset                              = { 0, 0, 0 };
-       tcu::ConstPixelBufferAccess resultImageAccess   = m_stateObjects->m_colorAttachmentImage->readSurface(
-               queue, m_context.getDefaultAllocator(), vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
-               zeroOffset, StateObjects::HEIGHT, StateObjects::WIDTH, vk::VK_IMAGE_ASPECT_COLOR_BIT);
-
-       log << tcu::TestLog::Image("Result", "Result", resultImageAccess);
-}
-
 template<class Instance>
 class QueryPoolOcclusionTest : public vkt::TestCase
 {