1 /* 2 * Copyright © 2022 Collabora, Ltd. 3 * SPDX-License-Identifier: MIT 4 */ 5 #ifndef NVK_PRIVATE_H 6 #define NVK_PRIVATE_H 1 7 8 #include <assert.h> 9 10 #include "vk_log.h" 11 #include "vk_util.h" 12 13 #define NVK_MAX_SETS 8 14 #define NVK_MAX_PUSH_SIZE 128 15 #define NVK_MAX_DYNAMIC_BUFFERS 64 16 #define NVK_MAX_RTS 8 17 #define NVK_MIN_SSBO_ALIGNMENT 16 18 #define NVK_MIN_TEXEL_BUFFER_ALIGNMENT 16 19 #define NVK_MIN_UBO_ALIGNMENT 64 20 #define NVK_MAX_VIEWPORTS 16 21 #define NVK_MAX_DESCRIPTOR_SIZE 16 22 #define NVK_MAX_PUSH_DESCRIPTORS 32 23 #define NVK_MAX_DESCRIPTOR_SET_SIZE (1u << 30) 24 #define NVK_MAX_DESCRIPTORS (1 << 20) 25 #define NVK_PUSH_DESCRIPTOR_SET_SIZE \ 26 (NVK_MAX_PUSH_DESCRIPTORS * NVK_MAX_DESCRIPTOR_SIZE) 27 #define NVK_SSBO_BOUNDS_CHECK_ALIGNMENT 4 28 #define NVK_MAX_MULTIVIEW_VIEW_COUNT 32 29 30 #define NVK_SPARSE_ADDR_SPACE_SIZE (1ull << 39) 31 #define NVK_MAX_BUFFER_SIZE (1ull << 31) 32 #define NVK_MAX_SHARED_SIZE (48 * 1024) 33 34 /* Max size of a bound cbuf */ 35 #define NVK_MAX_CBUF_SIZE (1u << 16) 36 37 struct nvk_addr_range { 38 uint64_t addr; 39 uint64_t range; 40 }; 41 42 /** 43 * Warn on ignored extension structs. 44 * 45 * The Vulkan spec requires us to ignore unsupported or unknown structs in 46 * a pNext chain. In debug mode, emitting warnings for ignored structs may 47 * help us discover structs that we should not have ignored. 48 * 49 * 50 * From the Vulkan 1.0.38 spec: 51 * 52 * Any component of the implementation (the loader, any enabled layers, 53 * and drivers) must skip over, without processing (other than reading the 54 * sType and pNext members) any chained structures with sType values not 55 * defined by extensions supported by that component. 56 */ 57 #define nvk_debug_ignored_stype(sType) \ 58 mesa_logd("%s: ignored VkStructureType %u\n", __func__, (sType)) 59 60 #endif 61