Mesa (main): dzn: use define instead of constexpr

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 19 16:29:45 UTC 2022


Module: Mesa
Branch: main
Commit: 502c36c07d549a60e96e8be4e6395c13dd98f00d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=502c36c07d549a60e96e8be4e6395c13dd98f00d

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Apr  7 14:51:37 2022 +0200

dzn: use define instead of constexpr

Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15816>

---

 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 da3d3de1990..494a7e8ae4a 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));
 



More information about the mesa-commit mailing list