From: Dave Airlie Date: Tue, 16 Jun 2020 02:45:26 +0000 (+1000) Subject: llvmpipe: pass number of images into image soa create X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f75c1e83e2e1c3b977aa7826549cc310506ca0f8;p=mesa.git llvmpipe: pass number of images into image soa create Just store this for now to use later with indexing Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index a3daf6a503b..7bd52bb78b0 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -175,7 +175,7 @@ generate_compute(struct llvmpipe_context *lp, assert(builder); LLVMPositionBuilderAtEnd(builder, block); sampler = lp_llvm_sampler_soa_create(key->samplers, key->nr_samplers); - image = lp_llvm_image_soa_create(lp_cs_variant_key_images(key)); + image = lp_llvm_image_soa_create(lp_cs_variant_key_images(key), key->nr_images); struct lp_build_loop_state loop_state[4]; LLVMValueRef num_x_loop; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 1d57f2553d2..9967b4a94ec 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -2917,7 +2917,7 @@ generate_fragment(struct llvmpipe_context *lp, /* code generated texture sampling */ sampler = lp_llvm_sampler_soa_create(key->samplers, key->nr_samplers); - image = lp_llvm_image_soa_create(lp_fs_variant_key_images(key)); + image = lp_llvm_image_soa_create(lp_fs_variant_key_images(key), key->nr_images); num_fs = 16 / fs_type.length; /* number of loops per 4x4 stamp */ /* for 1d resources only run "upper half" of stamp */ diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.c b/src/gallium/drivers/llvmpipe/lp_tex_sample.c index ea44970d0b7..1f29be56bf1 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.c @@ -94,6 +94,7 @@ struct lp_llvm_image_soa struct lp_build_image_soa base; struct llvmpipe_image_dynamic_state dynamic_state; + unsigned nr_images; }; @@ -495,7 +496,8 @@ lp_llvm_image_soa_emit_size_query(const struct lp_build_image_soa *base, } struct lp_build_image_soa * -lp_llvm_image_soa_create(const struct lp_image_static_state *static_state) +lp_llvm_image_soa_create(const struct lp_image_static_state *static_state, + unsigned nr_images) { struct lp_llvm_image_soa *image; @@ -519,5 +521,6 @@ lp_llvm_image_soa_create(const struct lp_image_static_state *static_state) image->dynamic_state.static_state = static_state; + image->nr_images = nr_images; return &image->base; } diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.h b/src/gallium/drivers/llvmpipe/lp_tex_sample.h index 5deff631499..51813ea5c95 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.h +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.h @@ -49,6 +49,7 @@ lp_llvm_sampler_soa_create(const struct lp_sampler_static_state *key, unsigned nr_samplers); struct lp_build_image_soa * -lp_llvm_image_soa_create(const struct lp_image_static_state *key); +lp_llvm_image_soa_create(const struct lp_image_static_state *key, + unsigned nr_images); #endif /* LP_TEX_SAMPLE_H */