VK_CHECK(vk.queueSubmit(queue, 1, &submitInfo, *m_fence));
VK_CHECK(vk.waitForFences(vkDevice, 1, &m_fence.get(), true, ~(0ull) /* infinity*/));
+ invalidateMappedMemoryRange(vk, vkDevice, m_outBufferAlloc->getMemory(), m_outBufferAlloc->getOffset(), (size_t)(sizeof(tcu::Vec4) * 8));
+
// verify result
std::vector<tcu::Vec4> expectValue(8, tcu::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
if (deMemCmp((void*)(&expectValue[0]), m_outBufferAlloc->getHostPtr(), (size_t)(sizeof(tcu::Vec4) * 8)))
mappedBlockPtrs = blockLocationsToPtrs(m_refLayout, blockLocations, mapPtrs);
copyData(m_refLayout, mappedBlockPtrs, m_refLayout, m_initialData.pointers);
- if (m_bufferMode == SSBOLayoutCase::BUFFERMODE_PER_BLOCK)
+ for (size_t allocNdx = 0; allocNdx < m_uniformAllocs.size(); allocNdx++)
{
- DE_ASSERT(m_uniformAllocs.size() == bufferSizes.size());
- for (size_t allocNdx = 0; allocNdx < m_uniformAllocs.size(); allocNdx++)
- {
- const int size = bufferSizes[allocNdx];
- vk::Allocation* alloc = m_uniformAllocs[allocNdx].get();
- flushMappedMemoryRange(vk, device, alloc->getMemory(), alloc->getOffset(), size);
- }
- }
- else
- {
- DE_ASSERT(m_bufferMode == SSBOLayoutCase::BUFFERMODE_SINGLE);
- DE_ASSERT(m_uniformAllocs.size() == 1);
- int totalSize = 0;
- for (size_t bufferNdx = 0; bufferNdx < bufferSizes.size(); bufferNdx++)
- {
- totalSize += bufferSizes[bufferNdx];
- }
-
- DE_ASSERT(totalSize > 0);
- vk::Allocation* alloc = m_uniformAllocs[0].get();
- flushMappedMemoryRange(vk, device, alloc->getMemory(), alloc->getOffset(), totalSize);
+ vk::Allocation* alloc = m_uniformAllocs[allocNdx].get();
+ flushMappedMemoryRange(vk, device, alloc->getMemory(), alloc->getOffset(), VK_WHOLE_SIZE);
}
}
}
const int refCount = 1;
int resCount = 0;
+ invalidateMappedMemoryRange(vk, device, acBufferAlloc->getMemory(), acBufferAlloc->getOffset(), acBufferSize);
+
resCount = *(const int*)((const deUint8*)acBufferAlloc->getHostPtr());
counterOk = (refCount == resCount);
}
}
+ for (size_t allocNdx = 0; allocNdx < m_uniformAllocs.size(); allocNdx++)
+ {
+ vk::Allocation *alloc = m_uniformAllocs[allocNdx].get();
+ invalidateMappedMemoryRange(vk, device, alloc->getMemory(), alloc->getOffset(), VK_WHOLE_SIZE);
+ }
+
// Validate result
const bool compareOk = compareData(m_context.getTestContext().getLog(), m_refLayout, m_writeData.pointers, m_refLayout, mappedBlockPtrs);