anv: Add a descriptor_index to anv_descriptor_set_binding_layout

This commit is contained in:
Jason Ekstrand 2015-11-06 12:07:36 -08:00
parent f029e0ce13
commit 45b1bbe801
3 changed files with 5 additions and 3 deletions

View file

@ -1529,6 +1529,7 @@ VkResult anv_CreateDescriptorSetLayout(
for (uint32_t b = 0; b < pCreateInfo->count; b++) {
uint32_t array_size = MAX2(1, pCreateInfo->pBinding[b].arraySize);
set_layout->binding[b].array_size = array_size;
set_layout->binding[b].descriptor_index = set_layout->size;
set_layout->size += array_size;
switch (pCreateInfo->pBinding[b].descriptorType) {

View file

@ -1230,9 +1230,9 @@ VkResult anv_CreatePipelineLayout(
for (uint32_t set = 0; set < pCreateInfo->descriptorSetCount; set++) {
struct anv_descriptor_set_layout *set_layout = l.set[set].layout;
unsigned set_offset = 0;
for (uint32_t b = 0; b < set_layout->binding_count; b++) {
unsigned array_size = set_layout->binding[b].array_size;
unsigned set_offset = set_layout->binding[b].descriptor_index;
if (set_layout->binding[b].stage[s].surface_index >= 0) {
assert(surface == l.set[set].stage[s].surface_start +
@ -1253,8 +1253,6 @@ VkResult anv_CreatePipelineLayout(
}
sampler += array_size;
}
set_offset += array_size;
}
}
}

View file

@ -689,6 +689,9 @@ struct anv_descriptor_set_binding_layout {
/* Number of array elements in this binding */
uint16_t array_size;
/* Index into the flattend descriptor set */
uint16_t descriptor_index;
/* Index into the dynamic state array for a dynamic buffer */
int16_t dynamic_offset_index;