DO NOT MERGE: Merge remote-tracking branch 'khronos/vulkan-cts-1.0.2' into HEAD
authorChris Forbes <chrisforbes@google.com>
Tue, 27 Feb 2018 00:31:59 +0000 (16:31 -0800)
committerChris Forbes <chrisforbes@google.com>
Mon, 30 Apr 2018 16:52:49 +0000 (16:52 +0000)
Change-Id: Id624bed0598e117aff161ee6ed92a135095e33d7
Bug: b/73945443

external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp
external/vulkancts/modules/vulkan/ycbcr/vktYCbCrConversionTests.cpp

index 024e826..256ec1e 100644 (file)
@@ -565,11 +565,20 @@ tcu::TestStatus                                                   DedicatedAllocationBufferTestInstance::bufferCreateAndAllo
        const deUint32                                          heapTypeIndex                                   = static_cast<deUint32>(deCtz32(memReqs.memoryRequirements.memoryTypeBits));
        const VkMemoryType                                      memoryType                                              = memoryProperties.memoryTypes[heapTypeIndex];
        const VkMemoryHeap                                      memoryHeap                                              = memoryProperties.memoryHeaps[memoryType.heapIndex];
-       const VkDeviceSize                                      maxBufferSize                                   = deAlign64(memoryHeap.size >> 1u, memReqs.memoryRequirements.alignment);
        const deUint32                                          shrinkBits                                              = 4u;   // number of bits to shift when reducing the size with each iteration
 
+       // Buffer size - Choose half of the reported heap size for the maximum buffer size, we
+       // should attempt to test as large a portion as possible.
+       //
+       // However on a system where device memory is shared with the system, the maximum size
+       // should be tested against the platform memory limits as a significant portion of the heap
+       // may already be in use by the operating system and other running processes.
+       const VkDeviceSize maxBufferSize = getMaxBufferSize(memoryHeap.size,
+                                                                                                          memReqs.memoryRequirements.alignment,
+                                                                                                          getPlatformMemoryLimits(m_context));
+
        Move<VkDeviceMemory>                            memory;
-       size = std::min(size, maxBufferSize);
+       size = deAlign64(std::min(size, maxBufferSize >> 1), memReqs.memoryRequirements.alignment);
        while (*memory == DE_NULL)
        {
                // Create the buffer
index 163f69e..442320a 100644 (file)
@@ -1207,7 +1207,7 @@ void calculateBounds (const ChannelAccess&                                        rPlane,
                                                        const IVec2     chromaJRange    (subsampledY ? calculateNearestIJRange(coordFormat, chromaV) : IVec2(j, j));
 
                                                        for (int chromaJ = chromaJRange.x(); chromaJ <= chromaJRange.y(); chromaJ++)
-                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.x(); chromaI++)
+                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.y(); chromaI++)
                                                        {
                                                                const Interval  srcColor[]      =
                                                                {
@@ -1231,7 +1231,7 @@ void calculateBounds (const ChannelAccess&                                        rPlane,
                                                        const IVec2     chromaJRange    (subsampledY ? calculateLinearIJRange(coordFormat, chromaV) : IVec2(j, j));
 
                                                        for (int chromaJ = chromaJRange.x(); chromaJ <= chromaJRange.y(); chromaJ++)
-                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.x(); chromaI++)
+                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.y(); chromaI++)
                                                        {
                                                                const Interval  chromaA (calculateAB(subTexelPrecisionBits, chromaU, chromaI));
                                                                const Interval  chromaB (calculateAB(subTexelPrecisionBits, chromaV, chromaJ));
@@ -1396,7 +1396,7 @@ void calculateBounds (const ChannelAccess&                                        rPlane,
                                                        const IVec2     chromaJRange    (calculateNearestIJRange(coordFormat, chromaV));
 
                                                        for (int chromaJ = chromaJRange.x(); chromaJ <= chromaJRange.y(); chromaJ++)
-                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.x(); chromaI++)
+                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.y(); chromaI++)
                                                        {
                                                                const Interval  srcColor[]      =
                                                                {
@@ -1419,7 +1419,7 @@ void calculateBounds (const ChannelAccess&                                        rPlane,
                                                        const IVec2     chromaJRange    (calculateNearestIJRange(coordFormat, chromaV));
 
                                                        for (int chromaJ = chromaJRange.x(); chromaJ <= chromaJRange.y(); chromaJ++)
-                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.x(); chromaI++)
+                                                       for (int chromaI = chromaIRange.x(); chromaI <= chromaIRange.y(); chromaI++)
                                                        {
                                                                const Interval  chromaA         (calculateAB(subTexelPrecisionBits, chromaU, chromaI));
                                                                const Interval  chromaB         (calculateAB(subTexelPrecisionBits, chromaV, chromaJ));