From 56d09cb032364972c6bb99f8e7aba91accb1f8c7 Mon Sep 17 00:00:00 2001 From: David Sodman Date: Mon, 21 Mar 2016 10:16:39 -0700 Subject: [PATCH] Add check to ensure memory and heap with DEVICE_LOCAL flags are consistent Fixes Vulkan-CTS/issues/5 Change-Id: I678fb69082d8c68bfe6ee13387ef64baa21223dc --- .../vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index 4c66021..60f0498 100755 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -873,6 +873,23 @@ tcu::TestStatus deviceMemoryProperties (Context& context) << memProps->memoryTypes[memoryNdx].propertyFlags << " not valid" << TestLog::EndMessage; return tcu::TestStatus::fail("deviceMemoryProperties propertyFlags not valid"); } + + if (memProps->memoryTypes[memoryNdx].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + { + if ((memProps->memoryHeaps[memProps->memoryTypes[memoryNdx].heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) == 0) + { + log << TestLog::Message << "deviceMemoryProperties - DEVICE_LOCAL memory type references heap which is not DEVICE_LOCAL" << TestLog::EndMessage; + return tcu::TestStatus::fail("deviceMemoryProperties inconsistent memoryType and HeapFlags"); + } + } + else + { + if (memProps->memoryHeaps[memProps->memoryTypes[memoryNdx].heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) + { + log << TestLog::Message << "deviceMemoryProperties - non-DEVICE_LOCAL memory type references heap with is DEVICE_LOCAL" << TestLog::EndMessage; + return tcu::TestStatus::fail("deviceMemoryProperties inconsistent memoryType and HeapFlags"); + } + } } bool* requiredFlagsFoundIterator = std::find(DE_ARRAY_BEGIN(requiredFlagsFound), DE_ARRAY_END(requiredFlagsFound), false); -- 2.7.4