From 6b6c1a7ddd64ad2952b9ae86b25c537f1dcfa51b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 29 Jun 2022 13:42:26 -0500 Subject: [PATCH] vulkan: Add a vk_limits.h file for runtime limits Individual driver limits may be smaller than these. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Lionel Landwerlin Part-of: --- src/vulkan/runtime/vk_command_buffer.h | 6 +---- src/vulkan/runtime/vk_limits.h | 32 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 src/vulkan/runtime/vk_limits.h diff --git a/src/vulkan/runtime/vk_command_buffer.h b/src/vulkan/runtime/vk_command_buffer.h index 4a9b3385a30..e910bef67f2 100644 --- a/src/vulkan/runtime/vk_command_buffer.h +++ b/src/vulkan/runtime/vk_command_buffer.h @@ -25,6 +25,7 @@ #define VK_COMMAND_BUFFER_H #include "vk_cmd_queue.h" +#include "vk_limits.h" #include "vk_object.h" #include "util/list.h" #include "util/u_dynarray.h" @@ -38,11 +39,6 @@ struct vk_framebuffer; struct vk_image_view; struct vk_render_pass; -/* Since VkSubpassDescription2::viewMask is a 32-bit integer, there are a - * maximum of 32 possible views. - */ -#define MESA_VK_MAX_MULTIVIEW_VIEW_COUNT 32 - struct vk_attachment_view_state { VkImageLayout layout; VkImageLayout stencil_layout; diff --git a/src/vulkan/runtime/vk_limits.h b/src/vulkan/runtime/vk_limits.h new file mode 100644 index 00000000000..d26c9d1fc6f --- /dev/null +++ b/src/vulkan/runtime/vk_limits.h @@ -0,0 +1,32 @@ +/* + * Copyright © 2022 Collabora, LTD + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef VK_LIMITS_H +#define VK_LIMITS_H + +/* Since VkSubpassDescription2::viewMask is a 32-bit integer, there are a + * maximum of 32 possible views. + */ +#define MESA_VK_MAX_MULTIVIEW_VIEW_COUNT 32 + +#endif /* VK_LIMITS_H */