uint32_t sampler_count[MESA_SHADER_STAGES] = { 0, };
uint32_t surface_count[MESA_SHADER_STAGES] = { 0, };
+ uint32_t image_count[MESA_SHADER_STAGES] = { 0, };
uint32_t dynamic_offset_count = 0;
for (uint32_t j = 0; j < pCreateInfo->bindingCount; j++) {
break;
}
+ if (binding->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) {
+ for_each_bit(s, binding->stageFlags) {
+ set_layout->binding[b].stage[s].image_index = image_count[s];
+ image_count[s] += binding->descriptorCount;
+ }
+ }
+
if (binding->pImmutableSamplers) {
set_layout->binding[b].immutable_samplers = samplers;
samplers += binding->descriptorCount;
for (gl_shader_stage s = 0; s < MESA_SHADER_STAGES; s++) {
l.set[set].stage[s].surface_start = l.stage[s].surface_count;
l.set[set].stage[s].sampler_start = l.stage[s].sampler_count;
+ l.set[set].stage[s].image_start = l.stage[s].image_count;
for (uint32_t b = 0; b < set_layout->binding_count; b++) {
unsigned array_size = set_layout->binding[b].array_size;
if (set_layout->binding[b].stage[s].sampler_index >= 0)
l.stage[s].sampler_count += array_size;
+
+ if (set_layout->binding[b].stage[s].image_index >= 0)
+ l.stage[s].image_count += array_size;
}
}
}
unsigned num_bindings = 0;
- for (gl_shader_stage s = 0; s < MESA_SHADER_STAGES; s++)
- num_bindings += l.stage[s].surface_count + l.stage[s].sampler_count;
+ for (gl_shader_stage s = 0; s < MESA_SHADER_STAGES; s++) {
+ num_bindings += l.stage[s].surface_count +
+ l.stage[s].sampler_count +
+ l.stage[s].image_count;
+ }
size_t size = sizeof(*layout) + num_bindings * sizeof(layout->entries[0]);
entry += l.stage[s].surface_count;
l.stage[s].sampler_to_descriptor = entry;
entry += l.stage[s].sampler_count;
+ entry += l.stage[s].image_count;
int surface = 0;
int sampler = 0;
/* Index into the sampler table for the associated sampler */
int16_t sampler_index;
+
+ /* Index into the image table for the associated image */
+ int16_t image_index;
} stage[MESA_SHADER_STAGES];
/* Immutable samplers (or NULL if no immutable samplers) */
struct {
uint32_t surface_start;
uint32_t sampler_start;
+ uint32_t image_start;
} stage[MESA_SHADER_STAGES];
} set[MAX_SETS];
struct anv_pipeline_binding *surface_to_descriptor;
uint32_t sampler_count;
struct anv_pipeline_binding *sampler_to_descriptor;
+ uint32_t image_count;
} stage[MESA_SHADER_STAGES];
struct anv_pipeline_binding entries[0];