From: Dave Airlie Date: Wed, 26 Jun 2019 05:34:52 +0000 (+1000) Subject: gallivm: add ssbo pointers to the soa build api. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ff697aa658b4718a1c6050c72dfb18d39b38069;p=mesa.git gallivm: add ssbo pointers to the soa build api. Need to pass ssbo + ssbo size pointers just like constants. Reviewed-by: Roland Scheidegger --- diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 73147e6852b..8a01509ed2f 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -630,7 +630,7 @@ generate_vs(struct draw_llvm_variant *variant, NULL, draw_sampler, &llvm->draw->vs.vertex_shader->info, - NULL); + NULL, NULL, NULL); { LLVMValueRef out; @@ -2363,7 +2363,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm, NULL, sampler, &llvm->draw->gs.geometry_shader->info, - (const struct lp_build_tgsi_gs_iface *)&gs_iface); + (const struct lp_build_tgsi_gs_iface *)&gs_iface, NULL, NULL); sampler->destroy(sampler); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h index 309ece88df2..824eff2af41 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h @@ -230,7 +230,9 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, LLVMValueRef thread_data_ptr, const struct lp_build_sampler_soa *sampler, const struct tgsi_shader_info *info, - const struct lp_build_tgsi_gs_iface *gs_iface); + const struct lp_build_tgsi_gs_iface *gs_iface, + LLVMValueRef ssbo_ptr, + LLVMValueRef ssbo_sizes_ptr); void @@ -452,6 +454,9 @@ struct lp_build_tgsi_soa_context LLVMValueRef context_ptr; LLVMValueRef thread_data_ptr; + LLVMValueRef ssbo_ptr; + LLVMValueRef ssbo_sizes_ptr; + const struct lp_build_sampler_soa *sampler; struct tgsi_declaration_sampler_view sv[PIPE_MAX_SHADER_SAMPLER_VIEWS]; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index d6af1d84471..edc66c4a37e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -3838,7 +3838,9 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, LLVMValueRef thread_data_ptr, const struct lp_build_sampler_soa *sampler, const struct tgsi_shader_info *info, - const struct lp_build_tgsi_gs_iface *gs_iface) + const struct lp_build_tgsi_gs_iface *gs_iface, + LLVMValueRef ssbo_ptr, + LLVMValueRef ssbo_sizes_ptr) { struct lp_build_tgsi_soa_context bld; @@ -3879,6 +3881,8 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, bld.outputs = outputs; bld.consts_ptr = consts_ptr; bld.const_sizes_ptr = const_sizes_ptr; + bld.ssbo_ptr = ssbo_ptr; + bld.ssbo_sizes_ptr = ssbo_sizes_ptr; bld.sampler = sampler; bld.bld_base.info = info; bld.indirect_files = info->indirect_files; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index b05997a3aab..2203779d55f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -479,7 +479,7 @@ generate_fs_loop(struct gallivm_state *gallivm, consts_ptr, num_consts_ptr, &system_values, interp->inputs, outputs, context_ptr, thread_data_ptr, - sampler, &shader->info.base, NULL); + sampler, &shader->info.base, NULL, NULL, NULL); /* Alpha test */ if (key->alpha.enabled) { diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp index 6ec492c4102..3f5a3688b0b 100644 --- a/src/gallium/drivers/swr/swr_shader.cpp +++ b/src/gallium/drivers/swr/swr_shader.cpp @@ -693,7 +693,8 @@ BuilderSWR::CompileGS(struct swr_context *ctx, swr_jit_gs_key &key) NULL, // thread data sampler, &gs->info.base, - &gs_iface.base); + &gs_iface.base, + NULL, NULL); // ssbos lp_build_mask_end(&mask); @@ -844,7 +845,8 @@ BuilderSWR::CompileVS(struct swr_context *ctx, swr_jit_vs_key &key) NULL, // thread data sampler, // sampler &swr_vs->info.base, - NULL); // geometry shader face + NULL, // geometry shader face + NULL, NULL); // ssbos sampler->destroy(sampler); @@ -1334,7 +1336,8 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key) NULL, // thread data sampler, // sampler &swr_fs->info.base, - NULL); // geometry shader face + NULL, // geometry shader face + NULL, NULL); //ssbos sampler->destroy(sampler);