gallivm: add ssbo pointers to the soa build api.
authorDave Airlie <airlied@redhat.com>
Wed, 26 Jun 2019 05:34:52 +0000 (15:34 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 7 Jul 2019 06:23:36 +0000 (16:23 +1000)
Need to pass ssbo + ssbo size pointers just like constants.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/swr/swr_shader.cpp

index 73147e6852bae2918eaa91598f808cb18e5c5323..8a01509ed2f79bdd5d060746938b935324b43c70 100644 (file)
@@ -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);
 
index 309ece88df22878dbee1c15b0a44bfd5868f1506..824eff2af4180e824c20285fb0c7bf8e5dabdc24 100644 (file)
@@ -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];
index d6af1d84471f1b8d38bfb2340d9b0ef043329587..edc66c4a37ea9dd3b8d345b76c3fc75e3200e19b 100644 (file)
@@ -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;
index b05997a3aab9a9c92514e17dc41446ec051576d4..2203779d55f53e3dbc2d3b68bf3b476e58bf8951 100644 (file)
@@ -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) {
index 6ec492c41022fae1ea5c6650a3d1052fd21202fc..3f5a3688b0beef36906580cafb906d175b0d440f 100644 (file)
@@ -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);