+static void
+draw_llvm_image_soa_emit_op(const struct lp_build_image_soa *base,
+ struct gallivm_state *gallivm,
+ const struct lp_img_params *params)
+{
+ struct draw_llvm_image_soa *image = (struct draw_llvm_image_soa *)base;
+ unsigned image_index = params->image_index;
+ assert(image_index < PIPE_MAX_SHADER_IMAGES);
+
+ lp_build_img_op_soa(&image->dynamic_state.static_state[image_index].image_state,
+ &image->dynamic_state.base,
+ gallivm, params);
+}
+/**
+ * Fetch the texture size.
+ */
+static void
+draw_llvm_image_soa_emit_size_query(const struct lp_build_image_soa *base,
+ struct gallivm_state *gallivm,
+ const struct lp_sampler_size_query_params *params)
+{
+ struct draw_llvm_image_soa *image = (struct draw_llvm_image_soa *)base;
+
+ assert(params->texture_unit < PIPE_MAX_SHADER_IMAGES);
+
+ lp_build_size_query_soa(gallivm,
+ &image->dynamic_state.static_state[params->texture_unit].image_state,
+ &image->dynamic_state.base,
+ params);
+}
+static void
+draw_llvm_image_soa_destroy(struct lp_build_image_soa *image)
+{
+ FREE(image);
+}
+
+struct lp_build_image_soa *
+draw_llvm_image_soa_create(const struct draw_image_static_state *static_state)
+{
+ struct draw_llvm_image_soa *image;
+
+ image = CALLOC_STRUCT(draw_llvm_image_soa);
+ if (!image)
+ return NULL;
+
+ image->base.destroy = draw_llvm_image_soa_destroy;
+ image->base.emit_op = draw_llvm_image_soa_emit_op;
+ image->base.emit_size_query = draw_llvm_image_soa_emit_size_query;
+
+ image->dynamic_state.base.width = draw_llvm_image_width;
+ image->dynamic_state.base.height = draw_llvm_image_height;
+
+ image->dynamic_state.base.depth = draw_llvm_image_depth;
+ image->dynamic_state.base.base_ptr = draw_llvm_image_base_ptr;
+ image->dynamic_state.base.row_stride = draw_llvm_image_row_stride;
+ image->dynamic_state.base.img_stride = draw_llvm_image_img_stride;
+
+ image->dynamic_state.static_state = static_state;
+
+ return &image->base;
+}