diff options
author | ziga-lunarg <ziga@lunarg.com> | 2022-11-19 20:06:44 +0100 |
---|---|---|
committer | Matthew Netsch <quic_mnetsch@quicinc.com> | 2022-12-08 18:01:11 +0000 |
commit | b7c817f2db2fe5c706f82517411400e047008a0c (patch) | |
tree | 4558f79239f6207ab9b20bf469333744388965eb | |
parent | ae8b8a07118a4e0dfc185a531abe234e9956725b (diff) | |
download | VK-GL-CTS-b7c817f2db2fe5c706f82517411400e047008a0c.tar.gz VK-GL-CTS-b7c817f2db2fe5c706f82517411400e047008a0c.tar.bz2 VK-GL-CTS-b7c817f2db2fe5c706f82517411400e047008a0c.zip |
Fix flushing memory range in memory model shared tests
Each size of pMemRanges in vkFlushMappedMemoryRanges must be either a
multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize or equal to the
size of memory
Components: Vulkan
VK-GL-CTS issue: 4123
Affected tests:
dEQP-VK.memory_model.shared.*
Change-Id: I0f3ea96736aa73eb92c7809c04297923d84e348c
-rw-r--r-- | external/vulkancts/modules/vulkan/memory_model/vktMemoryModelSharedLayoutCase.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/external/vulkancts/modules/vulkan/memory_model/vktMemoryModelSharedLayoutCase.cpp b/external/vulkancts/modules/vulkan/memory_model/vktMemoryModelSharedLayoutCase.cpp index be47515f1..343211069 100644 --- a/external/vulkancts/modules/vulkan/memory_model/vktMemoryModelSharedLayoutCase.cpp +++ b/external/vulkancts/modules/vulkan/memory_model/vktMemoryModelSharedLayoutCase.cpp @@ -362,6 +362,7 @@ tcu::TestStatus SharedLayoutCaseInstance::iterate (void) const vk::VkDevice device = m_context.getDevice(); const vk::VkQueue queue = m_context.getUniversalQueue(); const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex(); + vk::Allocator& allocator = m_context.getDefaultAllocator(); const deUint32 bufferSize = 4; // Create descriptor set @@ -378,12 +379,12 @@ tcu::TestStatus SharedLayoutCaseInstance::iterate (void) }; vk::Move<vk::VkBuffer> buffer (vk::createBuffer(vk, device, ¶ms)); - - de::MovePtr<vk::Allocation> bufferAlloc (vk::bindBuffer (m_context.getDeviceInterface(), m_context.getDevice(), - m_context.getDefaultAllocator(), *buffer, vk::MemoryRequirement::HostVisible)); + vk::VkMemoryRequirements requirements = getBufferMemoryRequirements(vk, device, *buffer); + de::MovePtr<vk::Allocation> bufferAlloc (allocator.allocate(requirements, vk::MemoryRequirement::HostVisible)); + VK_CHECK(vk.bindBufferMemory(device, *buffer, bufferAlloc->getMemory(), bufferAlloc->getOffset())); deMemset(bufferAlloc->getHostPtr(), 0, bufferSize); - flushMappedMemoryRange(vk, device, bufferAlloc->getMemory(), bufferAlloc->getOffset(), bufferSize); + flushMappedMemoryRange(vk, device, bufferAlloc->getMemory(), bufferAlloc->getOffset(), requirements.size); vk::DescriptorSetLayoutBuilder setLayoutBuilder; vk::DescriptorPoolBuilder poolBuilder; |