Skip to content

Commit 8657448

Browse files
committed
tests: Fix Test ICD regressions
1 parent e700c4e commit 8657448

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/icd/test_icd.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424

2525
namespace icd {
2626

27+
// https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/8776
28+
// things like shaderGroupBaseAlignment can be as big as 64, since these values are dynamically set in the Profile JSON, we need
29+
// to create the large alignment possible to satisfy them all
30+
static constexpr size_t memory_alignment = 64;
31+
2732
static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr(VkInstance instance, const char* funcName) {
2833
const auto& item = name_to_func_ptr_map.find(funcName);
2934
if (item != name_to_func_ptr_map.end()) {
@@ -556,11 +561,7 @@ static VKAPI_ATTR void VKAPI_CALL DestroyDevice(VkDevice device, const VkAllocat
556561
// Vulkan SC does not support vkFreeMemory therefore all mapped memory is implicitly unmapped during device destruction
557562
for (auto it : mapped_memory_map) {
558563
for (auto map_addr : it.second) {
559-
#if defined(_WIN32)
560-
_aligned_free(map_addr);
561-
#else
562-
free(map_addr);
563-
#endif
564+
::operator delete(map_addr, std::align_val_t(memory_alignment));
564565
}
565566
}
566567
mapped_memory_map.clear();
@@ -675,11 +676,6 @@ static VKAPI_ATTR void VKAPI_CALL FreeMemory(VkDevice device, VkDeviceMemory mem
675676
}
676677
#endif
677678

678-
// https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/8776
679-
// things like shaderGroupBaseAlignment can be as big as 64, since these values are dynamically set in the Profile JSON, we need
680-
// to create the large alignment possible to satisfy them all
681-
static constexpr size_t memory_alignment = 64;
682-
683679
static VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size,
684680
VkMemoryMapFlags flags, void** ppData) {
685681
unique_lock_t lock(global_lock);
@@ -904,6 +900,7 @@ static VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2(VkDevice device, c
904900
GetImageMemoryRequirements(device, pInfo->image, &pMemoryRequirements->memoryRequirements);
905901
}
906902

903+
#ifndef VULKANSC // Vulkan SC does not support VK_ARM_tensors
907904
static VKAPI_ATTR void VKAPI_CALL GetTensorMemoryRequirementsARM(VkDevice device, const VkTensorMemoryRequirementsInfoARM* pInfo,
908905
VkMemoryRequirements2* pMemoryRequirements)
909906
{
@@ -937,6 +934,7 @@ static VKAPI_ATTR void VKAPI_CALL GetDataGraphPipelineSessionMemoryRequirementsA
937934
// 3 is arbitrary, any value in [0,5] is acceptable, see GetPhysicalDeviceMemoryProperties.
938935
memReq.memoryTypeBits = 0xFFFF & ~(0x1 << 3);
939936
}
937+
#endif // VULKANSC
940938

941939
static VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
942940
VkMemoryRequirements2* pMemoryRequirements) {
@@ -1513,6 +1511,7 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2(VkPhysicalD
15131511
}
15141512
}
15151513

1514+
#ifndef VULKANSC // Vulkan SC does not support VK_ARM_tensors
15161515
static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalTensorPropertiesARM(
15171516
VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalTensorInfoARM* pExternalTensorInfo,
15181517
VkExternalTensorPropertiesARM* pExternalTensorProperties) {
@@ -1534,6 +1533,7 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalTensorPropertiesARM(
15341533
pExternalTensorProperties->externalMemoryProperties.compatibleHandleTypes = 0;
15351534
}
15361535
}
1536+
#endif // VULKANSC
15371537

15381538
static VKAPI_ATTR VkResult VKAPI_CALL
15391539
GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,

0 commit comments

Comments
 (0)