mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 13:00:09 +01:00
hk: Fix maxVariableDescriptorCount with inline uniform block
Same problem as NVK on VKCTS 1.4.4.0 Fixes:5bc8284816("hk: add Vulkan driver for Apple GPUs") Signed-off-by: Mary Guillemard <mary@mary.zone> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> (cherry picked from commit8447b99f61) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38167>
This commit is contained in:
parent
d9636807f7
commit
f02f5e217f
5 changed files with 31 additions and 25 deletions
|
|
@ -724,7 +724,7 @@
|
|||
"description": "hk: Fix maxVariableDescriptorCount with inline uniform block",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5bc828481630147575348b66677edaade9e891e6",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1,13 +1,4 @@
|
|||
# In current VKCTS main (c818e087743d122c2b604fecf7ed0533e543590a)
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_create_layout,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_extra_bindings,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_extra_bindings_create_layout,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_extra_bindings_nonzero_binding_offset,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_extra_bindings_nonzero_binding_offset_create_layout,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_nonzero_binding_offset,Fail
|
||||
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_nonzero_binding_offset_create_layout,Fail
|
||||
|
||||
dEQP-VK.image.host_image_copy.simple.astc_10x10_srgb_block.optimal.general_general.1_1,Crash
|
||||
dEQP-VK.image.host_image_copy.simple.astc_10x10_srgb_block.optimal.general_general.1_4,Crash
|
||||
dEQP-VK.image.host_image_copy.simple.astc_10x10_srgb_block.optimal.general_general.4_1,Crash
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ hk_GetDescriptorSetLayoutSupport(
|
|||
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++) {
|
||||
|
|
@ -362,6 +363,10 @@ hk_GetDescriptorSetLayoutSupport(
|
|||
*/
|
||||
variable_count = MAX2(1, binding->descriptorCount);
|
||||
variable_stride = stride;
|
||||
|
||||
variable_is_inline_uniform_block =
|
||||
binding->descriptorType ==
|
||||
VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK;
|
||||
} else {
|
||||
/* Since we're aligning to the maximum and since this is just a
|
||||
* check for whether or not the max buffer size is big enough, we
|
||||
|
|
@ -393,12 +398,21 @@ hk_GetDescriptorSetLayoutSupport(
|
|||
switch (ext->sType) {
|
||||
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
|
||||
VkDescriptorSetVariableDescriptorCountLayoutSupport *vs = (void *)ext;
|
||||
uint32_t max_var_count;
|
||||
|
||||
if (variable_stride > 0) {
|
||||
vs->maxVariableDescriptorCount =
|
||||
max_var_count =
|
||||
(max_buffer_size - non_variable_size) / variable_stride;
|
||||
} else {
|
||||
vs->maxVariableDescriptorCount = 0;
|
||||
max_var_count = 0;
|
||||
}
|
||||
|
||||
if (variable_is_inline_uniform_block) {
|
||||
max_var_count =
|
||||
MIN2(max_var_count, HK_MAX_INLINE_UNIFORM_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
vs->maxVariableDescriptorCount = max_var_count;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -859,7 +859,7 @@ hk_get_device_properties(const struct agx_device *dev,
|
|||
.maxSubgroupSize = 32,
|
||||
.maxComputeWorkgroupSubgroups = 1024 / 32,
|
||||
.requiredSubgroupSizeStages = 0,
|
||||
.maxInlineUniformBlockSize = 1 << 16,
|
||||
.maxInlineUniformBlockSize = HK_MAX_INLINE_UNIFORM_BLOCK_SIZE,
|
||||
.maxPerStageDescriptorInlineUniformBlocks = 32,
|
||||
.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = 32,
|
||||
.maxDescriptorSetInlineUniformBlocks = 6 * 32,
|
||||
|
|
|
|||
|
|
@ -12,18 +12,19 @@
|
|||
#include "vk_log.h"
|
||||
#include "vk_util.h"
|
||||
|
||||
#define HK_MAX_SETS 8
|
||||
#define HK_MAX_PUSH_SIZE 256
|
||||
#define HK_MAX_DYNAMIC_BUFFERS 64
|
||||
#define HK_MAX_RTS 8
|
||||
#define HK_MIN_SSBO_ALIGNMENT 16
|
||||
#define HK_MIN_TEXEL_BUFFER_ALIGNMENT 16
|
||||
#define HK_MIN_UBO_ALIGNMENT 64
|
||||
#define HK_MAX_VIEWPORTS 16
|
||||
#define HK_MAX_DESCRIPTOR_SIZE 64
|
||||
#define HK_MAX_PUSH_DESCRIPTORS 32
|
||||
#define HK_MAX_DESCRIPTOR_SET_SIZE (1u << 30)
|
||||
#define HK_MAX_DESCRIPTORS (1 << 20)
|
||||
#define HK_MAX_SETS 8
|
||||
#define HK_MAX_PUSH_SIZE 256
|
||||
#define HK_MAX_DYNAMIC_BUFFERS 64
|
||||
#define HK_MAX_RTS 8
|
||||
#define HK_MIN_SSBO_ALIGNMENT 16
|
||||
#define HK_MIN_TEXEL_BUFFER_ALIGNMENT 16
|
||||
#define HK_MIN_UBO_ALIGNMENT 64
|
||||
#define HK_MAX_VIEWPORTS 16
|
||||
#define HK_MAX_DESCRIPTOR_SIZE 64
|
||||
#define HK_MAX_PUSH_DESCRIPTORS 32
|
||||
#define HK_MAX_DESCRIPTOR_SET_SIZE (1u << 30)
|
||||
#define HK_MAX_INLINE_UNIFORM_BLOCK_SIZE (1u << 16)
|
||||
#define HK_MAX_DESCRIPTORS (1 << 20)
|
||||
#define HK_PUSH_DESCRIPTOR_SET_SIZE \
|
||||
(HK_MAX_PUSH_DESCRIPTORS * HK_MAX_DESCRIPTOR_SIZE)
|
||||
#define HK_SSBO_BOUNDS_CHECK_ALIGNMENT 4
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue