}
}
+ nir_foreach_variable(var, &shader->uniforms) {
+ if (!glsl_type_is_image(var->interface_type))
+ continue;
+
+ enum glsl_sampler_dim dim = glsl_get_sampler_dim(var->interface_type);
+ if (dim != GLSL_SAMPLER_DIM_SUBPASS &&
+ dim != GLSL_SAMPLER_DIM_SUBPASS_MS)
+ continue;
+
+ const uint32_t set = var->data.descriptor_set;
+ const uint32_t binding = var->data.binding;
+ const uint32_t array_size =
+ layout->set[set].layout->binding[binding].array_size;
+
+ if (!BITSET_TEST(state.set[set].used, binding))
+ continue;
+
+ struct anv_pipeline_binding *pipe_binding =
+ &map->surface_to_descriptor[state.set[set].surface_offsets[binding]];
+ for (unsigned i = 0; i < array_size; i++) {
+ assert(pipe_binding[i].set == set);
+ assert(pipe_binding[i].binding == binding);
+ assert(pipe_binding[i].index == i);
+ pipe_binding[i].input_attachment_index = var->data.index + i;
+ }
+ }
+
nir_foreach_function(function, shader) {
if (!function->impl)
continue;
/* Index in the binding */
uint8_t index;
+
+ /* Input attachment index (relative to the subpass) */
+ uint8_t input_attachment_index;
};
struct anv_pipeline_layout {