mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
anv, hasvk: pMutableDescriptorTypeLists can be out of range on pool creation
The spec for vkCreateDescriptorPool says: If VkMutableDescriptorTypeCreateInfoEXT does not exist in the pNext chain, or VkMutableDescriptorTypeCreateInfoEXT::pMutableDescriptorTypeLists[i] is out of range, the descriptor pool allocates enough memory to be able to allocate a VK_DESCRIPTOR_TYPE_MUTABLE_EXT descriptor with any supported VkDescriptorType as a mutable descriptor. So check that mutableDescriptorTypeListCount is in range of the binding we are asking for instead of just 0. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28031>
This commit is contained in:
parent
0e1862a2ab
commit
d039764410
2 changed files with 4 additions and 4 deletions
|
|
@ -237,7 +237,7 @@ anv_descriptor_data_for_mutable_type(const struct anv_physical_device *device,
|
|||
{
|
||||
enum anv_descriptor_data desc_data = 0;
|
||||
|
||||
if (!mutable_info || mutable_info->mutableDescriptorTypeListCount == 0) {
|
||||
if (!mutable_info || mutable_info->mutableDescriptorTypeListCount <= binding) {
|
||||
for(VkDescriptorType i = 0; i <= VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; i++) {
|
||||
if (i == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ||
|
||||
i == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
|
|
@ -356,7 +356,7 @@ anv_descriptor_size_for_mutable_type(const struct anv_physical_device *device,
|
|||
*out_sampler_stride = 0;
|
||||
|
||||
if (!mutable_info ||
|
||||
mutable_info->mutableDescriptorTypeListCount == 0 ||
|
||||
mutable_info->mutableDescriptorTypeListCount <= binding ||
|
||||
binding >= mutable_info->mutableDescriptorTypeListCount) {
|
||||
for(VkDescriptorType i = 0; i <= VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; i++) {
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ anv_descriptor_data_for_mutable_type(const struct anv_physical_device *device,
|
|||
{
|
||||
enum anv_descriptor_data desc_data = 0;
|
||||
|
||||
if (!mutable_info || mutable_info->mutableDescriptorTypeListCount == 0) {
|
||||
if (!mutable_info || mutable_info->mutableDescriptorTypeListCount <= binding) {
|
||||
for(VkDescriptorType i = 0; i <= VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; i++) {
|
||||
if (i == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ||
|
||||
i == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
|
|
@ -209,7 +209,7 @@ anv_descriptor_size_for_mutable_type(const struct anv_physical_device *device,
|
|||
{
|
||||
unsigned size = 0;
|
||||
|
||||
if (!mutable_info || mutable_info->mutableDescriptorTypeListCount == 0) {
|
||||
if (!mutable_info || mutable_info->mutableDescriptorTypeListCount <= binding) {
|
||||
for(VkDescriptorType i = 0; i <= VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; i++) {
|
||||
|
||||
if (i == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue