nvk/descriptor_set_layout: Record which dynamic buffers are UBOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
This commit is contained in:

committed by
Marge Bot

parent
6e41f2a28d
commit
248b22d158
@@ -192,10 +192,17 @@ nvk_CreateDescriptorSetLayout(VkDevice device,
|
||||
|
||||
switch (binding->descriptorType) {
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
||||
layout->binding[b].dynamic_buffer_index = dynamic_buffer_count;
|
||||
BITSET_SET_RANGE(layout->dynamic_ubos, dynamic_buffer_count,
|
||||
dynamic_buffer_count + binding->descriptorCount - 1);
|
||||
dynamic_buffer_count += binding->descriptorCount;
|
||||
break;
|
||||
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
|
||||
layout->binding[b].dynamic_buffer_index = dynamic_buffer_count;
|
||||
dynamic_buffer_count += binding->descriptorCount;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -10,6 +10,8 @@
|
||||
#include "vk_descriptor_set_layout.h"
|
||||
#include "vk_object.h"
|
||||
|
||||
#include "util/bitset.h"
|
||||
|
||||
struct nvk_device;
|
||||
struct nvk_physical_device;
|
||||
struct nvk_sampler;
|
||||
@@ -50,6 +52,9 @@ struct nvk_descriptor_set_layout {
|
||||
/* Number of dynamic UBO bindings in this set */
|
||||
uint8_t dynamic_buffer_count;
|
||||
|
||||
/* Which dynamic buffers are UBOs */
|
||||
BITSET_DECLARE(dynamic_ubos, NVK_MAX_DYNAMIC_BUFFERS);
|
||||
|
||||
/* Number of bindings in this descriptor set */
|
||||
uint32_t binding_count;
|
||||
|
||||
|
Reference in New Issue
Block a user