Skip to content

Commit

Permalink
tests: Fix alignment for testICD
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Jan 13, 2025
1 parent ea05bf7 commit 7714733
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/icd/test_icd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,16 @@ static VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory
else
size = 0x10000;
}
void* map_addr = malloc((size_t)size);

// https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/8776
// things like shaderGroupBaseAlignment can be as big as 64, since these values are dynamically set in the Profile JSON, we need
// to create the large alignment possible to satisfy them all
static const size_t memory_alignment = 64;
#if defined(_WIN32)
void* map_addr = _aligned_malloc((size_t)size, memory_alignment);
#else
void* map_addr = aligned_alloc(memory_alignment, (size_t)size);
#endif
mapped_memory_map[memory].push_back(map_addr);
*ppData = map_addr;
return VK_SUCCESS;
Expand Down

0 comments on commit 7714733

Please sign in to comment.