draw: pass number of images to image soa create
authorDave Airlie <airlied@redhat.com>
Tue, 19 May 2020 01:55:38 +0000 (11:55 +1000)
committerMarge Bot <eric+marge@anholt.net>
Thu, 2 Jul 2020 04:12:17 +0000 (04:12 +0000)
This is stored for now but will be used as part of indirect
image support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_llvm.h
src/gallium/auxiliary/draw/draw_llvm_sample.c

index 483b631fe8eed5de153db4b5d002add2c8a06342..41018e82dcf55078288a61d2dc1253fdc279be7a 100644 (file)
@@ -2034,7 +2034,8 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
    /* code generated texture sampling */
    sampler = draw_llvm_sampler_soa_create(draw_llvm_variant_key_samplers(key), key->nr_samplers);
 
-   image = draw_llvm_image_soa_create(draw_llvm_variant_key_images(key));
+   image = draw_llvm_image_soa_create(draw_llvm_variant_key_images(key),
+                                      key->nr_images);
 
    step = lp_build_const_int32(gallivm, vector_length);
 
@@ -2822,7 +2823,8 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
 
    /* code generated texture sampling */
    sampler = draw_llvm_sampler_soa_create(variant->key.samplers, variant->key.nr_samplers);
-   image = draw_llvm_image_soa_create(draw_gs_llvm_variant_key_images(&variant->key));
+   image = draw_llvm_image_soa_create(draw_gs_llvm_variant_key_images(&variant->key),
+                                      variant->key.nr_images);
    mask_val = generate_mask_value(variant, gs_type);
    lp_build_mask_begin(&mask, gallivm, gs_type, mask_val);
 
@@ -3430,7 +3432,8 @@ draw_tcs_llvm_generate(struct draw_llvm *llvm,
    num_ssbos_ptr =
       draw_tcs_jit_context_num_ssbos(variant->gallivm, context_ptr);
    sampler = draw_llvm_sampler_soa_create(variant->key.samplers, variant->key.nr_samplers);
-   image = draw_llvm_image_soa_create(draw_tcs_llvm_variant_key_images(&variant->key));
+   image = draw_llvm_image_soa_create(draw_tcs_llvm_variant_key_images(&variant->key),
+                                      variant->key.nr_images);
 
    LLVMValueRef counter = LLVMGetParam(variant_coro, 5);
    LLVMValueRef invocvec = LLVMGetUndef(LLVMVectorType(int32_type, vector_length));
@@ -3927,7 +3930,8 @@ draw_tes_llvm_generate(struct draw_llvm *llvm,
    num_ssbos_ptr =
       draw_tes_jit_context_num_ssbos(variant->gallivm, context_ptr);
    sampler = draw_llvm_sampler_soa_create(variant->key.samplers, variant->key.nr_samplers);
-   image = draw_llvm_image_soa_create(draw_tes_llvm_variant_key_images(&variant->key));
+   image = draw_llvm_image_soa_create(draw_tes_llvm_variant_key_images(&variant->key),
+                                      variant->key.nr_images);
    step = lp_build_const_int32(gallivm, vector_length);
 
    system_values.tess_outer = LLVMBuildLoad(builder, tess_outer, "");
index 949b4c756220b069ffae536999fc713ff61c6a0b..c75179cb957cdf91878cbbceaa5fd55a5c7a991b 100644 (file)
@@ -894,7 +894,8 @@ draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_stat
                              unsigned nr_samplers);
 
 struct lp_build_image_soa *
-draw_llvm_image_soa_create(const struct draw_image_static_state *static_state);
+draw_llvm_image_soa_create(const struct draw_image_static_state *static_state,
+                           unsigned nr_images);
 
 void
 draw_llvm_set_sampler_state(struct draw_context *draw,
index faffe42a0d1cc89cc1f00f4c9cd697eb85e72ed0..ed78066d6900fc1938eddfec14f78968ef0d0d99 100644 (file)
@@ -86,6 +86,8 @@ struct draw_llvm_image_soa
    struct lp_build_image_soa base;
 
    struct draw_llvm_image_dynamic_state dynamic_state;
+
+   unsigned nr_images;
 };
 
 /**
@@ -446,7 +448,8 @@ draw_llvm_image_soa_destroy(struct lp_build_image_soa *image)
 }
 
 struct lp_build_image_soa *
-draw_llvm_image_soa_create(const struct draw_image_static_state *static_state)
+draw_llvm_image_soa_create(const struct draw_image_static_state *static_state,
+                           unsigned nr_images)
 {
    struct draw_llvm_image_soa *image;
 
@@ -470,5 +473,6 @@ draw_llvm_image_soa_create(const struct draw_image_static_state *static_state)
 
    image->dynamic_state.static_state = static_state;
 
+   image->nr_images = nr_images;
    return &image->base;
 }