Fix issues in pipeline.timestamp.transfer_tests
authorPyry Haulos <phaulos@google.com>
Thu, 9 Mar 2017 17:46:29 +0000 (09:46 -0800)
committerMika Isojärvi <misojarvi@google.com>
Wed, 30 Aug 2017 22:52:43 +0000 (15:52 -0700)
This change fixes two issues:

 * Buffer overrun in vkCmdCopyBufferToImage and vkCmdCopyImageToBuffer
tests.

 * Validation error (srcStageMask must not be 0).

VK-GL-CTS issue: 185
Components: Vulkan

Change-Id: I9679566f08c4a914eb6066bab248abd6d51e0f7e

external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp

index 692367e..f5dc98d 100644 (file)
@@ -2016,7 +2016,7 @@ void TransferTestInstance::configCommandBuffer(void)
                                const VkBufferImageCopy bufImageCopy =
                                {
                                        0u,                                     // VkDeviceSize            bufferOffset;
-                                       (deUint32)m_bufSize,                    // deUint32                bufferRowLength;
+                                       (deUint32)m_imageWidth,                 // deUint32                bufferRowLength;
                                        (deUint32)m_imageHeight,                // deUint32                bufferImageHeight;
                                        imgSubResCopy,                          // VkImageSubresourceCopy  imageSubresource;
                                        nullOffset,                             // VkOffset3D              imageOffset;
@@ -2030,7 +2030,7 @@ void TransferTestInstance::configCommandBuffer(void)
                                const VkBufferImageCopy imgBufferCopy =
                                {
                                        0u,                                     // VkDeviceSize            bufferOffset;
-                                       (deUint32)m_bufSize,                    // deUint32                bufferRowLength;
+                                       (deUint32)m_imageWidth,                 // deUint32                bufferRowLength;
                                        (deUint32)m_imageHeight,                // deUint32                bufferImageHeight;
                                        imgSubResCopy,                          // VkImageSubresourceCopy  imageSubresource;
                                        nullOffset,                             // VkOffset3D              imageOffset;
@@ -2140,7 +2140,7 @@ void TransferTestInstance::initialImageTransition (VkCommandBuffer cmdBuffer, Vk
                subRange                                // VkImageSubresourceRange  subresourceRange;
        };
 
-       vk.cmdPipelineBarrier(cmdBuffer, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, DE_NULL, 0, DE_NULL, 1, &imageMemBarrier);
+       vk.cmdPipelineBarrier(cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, DE_NULL, 0, DE_NULL, 1, &imageMemBarrier);
 }
 
 } // anonymous