Fix validation in dynamic offset tests
authorGraeme Leese <gleese@broadcom.com>
Tue, 16 Oct 2018 10:24:17 +0000 (11:24 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 22 Oct 2018 09:28:18 +0000 (05:28 -0400)
Correct memory flush/invalidate ranges and use "readonly" on buffers.

Components: Vulkan
Affects: dEQP-VK.pipeline.dynamic_offset.graphics.*

Change-Id: Ie76a9a08f3b852560771e77eacd7b00a0ec42601

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

index c72fe6f..776478c 100644 (file)
@@ -375,7 +375,7 @@ void DynamicOffsetGraphicsTestInstance::init (void)
                VK_CHECK(vk.bindBufferMemory(vkDevice, *m_buffer, m_bufferAlloc->getMemory(), m_bufferAlloc->getOffset()));
 
                deMemcpy(m_bufferAlloc->getHostPtr(), hostBuffer.data(), (size_t)bufferSize);
-               flushMappedMemoryRange(vk, vkDevice, m_bufferAlloc->getMemory(), m_bufferAlloc->getOffset(), bufferSize);
+               flushAlloc(vk, vkDevice, *m_bufferAlloc);
        }
 
        // Create descriptor pool
@@ -513,7 +513,7 @@ void DynamicOffsetGraphicsTestInstance::init (void)
 
                // Load vertices into vertex buffer
                deMemcpy(m_vertexBufferAlloc->getHostPtr(), m_vertices.data(), m_vertices.size() * sizeof(Vertex4RGBA));
-               flushMappedMemoryRange(vk, vkDevice, m_vertexBufferAlloc->getMemory(), m_vertexBufferAlloc->getOffset(), vertexBufferParams.size);
+               flushAlloc(vk, vkDevice, *m_vertexBufferAlloc);
        }
 
        // Create command pool
@@ -666,7 +666,7 @@ TestInstance* DynamicOffsetGraphicsTest::createInstance (Context& context) const
 void DynamicOffsetGraphicsTest::initPrograms (SourceCollections& sourceCollections) const
 {
        const deUint32  numBindings     = m_params.numDynamicBindings + m_params.numNonDynamicBindings;
-       const string    bufferType      = m_params.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ? "uniform" : "buffer";
+       const string    bufferType      = m_params.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ? "uniform" : "readonly buffer";
        string                  inputBlocks;
        string                  inputSum;
 
@@ -839,7 +839,7 @@ void DynamicOffsetComputeTestInstance::init (void)
                VK_CHECK(vk.bindBufferMemory(vkDevice, *m_buffer, m_bufferAlloc->getMemory(), m_bufferAlloc->getOffset()));
 
                deMemcpy(m_bufferAlloc->getHostPtr(), hostBuffer.data(), (size_t)bufferSize);
-               flushMappedMemoryRange(vk, vkDevice, m_bufferAlloc->getMemory(), m_bufferAlloc->getOffset(), bufferSize);
+               flushAlloc(vk, vkDevice, *m_bufferAlloc);
        }
 
        // Create output buffer
@@ -1047,7 +1047,7 @@ tcu::TestStatus DynamicOffsetComputeTestInstance::verifyOutput (void)
                refColors[i] = refColor;
        }
 
-       invalidateMappedMemoryRange(vk, vkDevice, m_outputBufferAlloc->getMemory(), m_outputBufferAlloc->getOffset(), VK_WHOLE_SIZE);
+       invalidateAlloc(vk, vkDevice, *m_outputBufferAlloc);
 
        // Grab the output results using offset alignment
        for (deUint32 i = 0; i < numOutputColors; i++)