mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 03:00:11 +01:00
nvk: Fix maxVariableDescriptorCount with iub
Otherwise, we would report very high values for inline uniform block
since NVK_MAX_DESCRIPTOR_SET_SIZE is a lot larger than
NVK_MAX_INLINE_UNIFORM_BLOCK_SIZE.
Fixes
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_nonzero_binding_offset
on vulkan-cts-1.4.4.0
Fixes: 6a74b3e311 ("nvk: Support VkDescriptorSetVariableDescriptorCountLayoutSupport")
Reviewed-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37878>
This commit is contained in:
parent
db9dbcbec0
commit
ff7f785f09
3 changed files with 8 additions and 1 deletions
|
|
@ -448,6 +448,7 @@ nvk_GetDescriptorSetLayoutSupport(VkDevice device,
|
|||
uint64_t non_variable_size = 0;
|
||||
uint32_t variable_stride = 0;
|
||||
uint32_t variable_count = 0;
|
||||
bool variable_is_inline_uniform_block = false;
|
||||
uint8_t dynamic_buffer_count = 0;
|
||||
|
||||
for (uint32_t i = 0; i < pCreateInfo->bindingCount; i++) {
|
||||
|
|
@ -473,6 +474,9 @@ nvk_GetDescriptorSetLayoutSupport(VkDevice device,
|
|||
assert(stride <= UINT8_MAX);
|
||||
assert(util_is_power_of_two_nonzero(alignment));
|
||||
|
||||
variable_is_inline_uniform_block =
|
||||
binding->descriptorType == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK;
|
||||
|
||||
if (flags & VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT) {
|
||||
/* From the Vulkan 1.3.256 spec:
|
||||
*
|
||||
|
|
@ -503,6 +507,8 @@ nvk_GetDescriptorSetLayoutSupport(VkDevice device,
|
|||
if (pCreateInfo->flags &
|
||||
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR)
|
||||
max_buffer_size = NVK_MAX_PUSH_DESCRIPTORS * nvk_max_descriptor_size(&pdev->info);
|
||||
else if (variable_is_inline_uniform_block)
|
||||
max_buffer_size = NVK_MAX_INLINE_UNIFORM_BLOCK_SIZE;
|
||||
else
|
||||
max_buffer_size = NVK_MAX_DESCRIPTOR_SET_SIZE;
|
||||
|
||||
|
|
|
|||
|
|
@ -970,7 +970,7 @@ nvk_get_device_properties(const struct nvk_instance *instance,
|
|||
.maxSubgroupSize = 32,
|
||||
.maxComputeWorkgroupSubgroups = 1024 / 32,
|
||||
.requiredSubgroupSizeStages = 0,
|
||||
.maxInlineUniformBlockSize = 1 << 16,
|
||||
.maxInlineUniformBlockSize = NVK_MAX_INLINE_UNIFORM_BLOCK_SIZE,
|
||||
.maxPerStageDescriptorInlineUniformBlocks = 32,
|
||||
.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = 32,
|
||||
.maxDescriptorSetInlineUniformBlocks = 6 * 32,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#define NVK_MAX_DESCRIPTOR_SIZE 32
|
||||
#define NVK_MAX_PUSH_DESCRIPTORS 32
|
||||
#define NVK_MAX_DESCRIPTOR_SET_SIZE (1u << 30)
|
||||
#define NVK_MAX_INLINE_UNIFORM_BLOCK_SIZE (1u << 16)
|
||||
#define NVK_MAX_DESCRIPTORS (1 << 20)
|
||||
#define NVK_PUSH_DESCRIPTOR_SET_SIZE \
|
||||
(NVK_MAX_PUSH_DESCRIPTORS * NVK_MAX_DESCRIPTOR_SIZE)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue