From: Dave Airlie Date: Tue, 19 May 2020 01:55:38 +0000 (+1000) Subject: draw: pass number of images to image soa create X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8a4ef09e7e02b155de658f09df948dd6244e0b8d;p=mesa.git draw: pass number of images to image soa create This is stored for now but will be used as part of indirect image support Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 483b631fe8e..41018e82dcf 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -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, ""); diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h index 949b4c75622..c75179cb957 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.h +++ b/src/gallium/auxiliary/draw/draw_llvm.h @@ -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, diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c index faffe42a0d1..ed78066d690 100644 --- a/src/gallium/auxiliary/draw/draw_llvm_sample.c +++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c @@ -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; }