From 502c36c07d549a60e96e8be4e6395c13dd98f00d Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 7 Apr 2022 14:51:37 +0200 Subject: [PATCH] dzn: use define instead of constexpr Reviewed-by: Boris Brezillon Part-of: --- src/microsoft/vulkan/dzn_device.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/microsoft/vulkan/dzn_device.cpp b/src/microsoft/vulkan/dzn_device.cpp index da3d3de..494a7e8 100644 --- a/src/microsoft/vulkan/dzn_device.cpp +++ b/src/microsoft/vulkan/dzn_device.cpp @@ -55,6 +55,8 @@ #define DZN_API_VERSION VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION) +#define MAX_TIER2_MEMORY_TYPES 3 + static const struct vk_instance_extension_table instance_extensions = { .KHR_get_physical_device_properties2 = true, #ifdef DZN_USE_WSI_PLATFORM @@ -389,12 +391,11 @@ dzn_physical_device_init_memory(struct dzn_physical_device *pdev) mem->memoryTypes[1].propertyFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; } - constexpr unsigned MaxTier2MemoryTypes = 3; - assert(mem->memoryTypeCount <= MaxTier2MemoryTypes); + assert(mem->memoryTypeCount <= MAX_TIER2_MEMORY_TYPES); if (pdev->options.ResourceHeapTier == D3D12_RESOURCE_HEAP_TIER_1) { unsigned oldMemoryTypeCount = mem->memoryTypeCount; - VkMemoryType oldMemoryTypes[MaxTier2MemoryTypes]; + VkMemoryType oldMemoryTypes[MAX_TIER2_MEMORY_TYPES]; memcpy(oldMemoryTypes, mem->memoryTypes, oldMemoryTypeCount * sizeof(VkMemoryType)); -- 2.7.4