summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-07-22 12:04:27 +1000
committerDave Airlie <[email protected]>2019-07-24 09:20:09 +1000
commit2631fd3b0bf5027ff904bf0e11ca271bda14a4b1 (patch)
treea8ec3c9876737bc2f557739ca7fa784ea34ec1e9 /src/gallium/drivers
parent9700e45463fa6b4b5c0535b7bafa0c438eeaee84 (diff)
gallivm: rework lp_build_tgsi_soa to take a struct
The parameters were getting messy and I have to add a few more for compute shaders, so clean it up before proceeding. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c22
-rw-r--r--src/gallium/drivers/swr/swr_shader.cpp78
2 files changed, 56 insertions, 44 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 9efad74b741..eabe8572111 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -478,12 +478,24 @@ generate_fs_loop(struct gallivm_state *gallivm,
lp_build_interp_soa_update_inputs_dyn(interp, gallivm, loop_state.counter);
+ struct lp_build_tgsi_params params = {};
+
+ params.type = type;
+ params.mask = &mask;
+ params.consts_ptr = consts_ptr;
+ params.const_sizes_ptr = num_consts_ptr;
+ params.system_values = &system_values;
+ params.inputs = interp->inputs;
+ params.context_ptr = context_ptr;
+ params.thread_data_ptr = thread_data_ptr;
+ params.sampler = sampler;
+ params.info = &shader->info.base;
+ params.ssbo_ptr = ssbo_ptr;
+ params.ssbo_sizes_ptr = num_ssbo_ptr;
+
/* Build the actual shader */
- lp_build_tgsi_soa(gallivm, tokens, type, &mask,
- consts_ptr, num_consts_ptr, &system_values,
- interp->inputs,
- outputs, context_ptr, thread_data_ptr,
- sampler, &shader->info.base, NULL, ssbo_ptr, num_ssbo_ptr);
+ lp_build_tgsi_soa(gallivm, tokens, &params,
+ outputs);
/* 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 f3492bd429c..3fc2ef4ced8 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -681,21 +681,22 @@ BuilderSWR::CompileGS(struct swr_context *ctx, swr_jit_gs_key &key)
gs_iface.info = info;
gs_iface.pVtxAttribMap = vtxAttribMap;
+ struct lp_build_tgsi_params params = {};
+ params.type = lp_type_float_vec(32, 32 * 8);
+ params.mask = & mask;
+ params.consts_ptr = wrap(consts_ptr);
+ params.const_sizes_ptr = wrap(const_sizes_ptr);
+ params.system_values = &system_values;
+ params.inputs = inputs;
+ params.context_ptr = wrap(hPrivateData);
+ params.sampler = sampler;
+ params.info = &gs->info.base;
+ params.gs_iface = &gs_iface.base;
+
lp_build_tgsi_soa(gallivm,
gs->pipe.tokens,
- lp_type_float_vec(32, 32 * 8),
- &mask,
- wrap(consts_ptr),
- wrap(const_sizes_ptr),
- &system_values,
- inputs,
- outputs,
- wrap(hPrivateData), // (sampler context)
- NULL, // thread data
- sampler,
- &gs->info.base,
- &gs_iface.base,
- NULL, NULL); // ssbos
+ &params,
+ outputs);
lp_build_mask_end(&mask);
@@ -833,21 +834,20 @@ BuilderSWR::CompileVS(struct swr_context *ctx, swr_jit_vs_key &key)
uint32_t vectorWidth = mVWidth;
#endif
+ struct lp_build_tgsi_params params = {};
+ params.type = lp_type_float_vec(32, 32 * vectorWidth);
+ params.consts_ptr = wrap(consts_ptr);
+ params.const_sizes_ptr = wrap(const_sizes_ptr);
+ params.system_values = &system_values;
+ params.inputs = inputs;
+ params.context_ptr = wrap(hPrivateData);
+ params.sampler = sampler;
+ params.info = &swr_vs->info.base;
+
lp_build_tgsi_soa(gallivm,
swr_vs->pipe.tokens,
- lp_type_float_vec(32, 32 * vectorWidth),
- NULL, // mask
- wrap(consts_ptr),
- wrap(const_sizes_ptr),
- &system_values,
- inputs,
- outputs,
- wrap(hPrivateData), // (sampler context)
- NULL, // thread data
- sampler, // sampler
- &swr_vs->info.base,
- NULL, // geometry shader face
- NULL, NULL); // ssbos
+ &params,
+ outputs);
sampler->destroy(sampler);
@@ -1324,21 +1324,21 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
uses_mask = true;
}
+ struct lp_build_tgsi_params params = {};
+ params.type = lp_type_float_vec(32, 32 * 8);
+ params.mask = uses_mask ? &mask : NULL;
+ params.consts_ptr = wrap(consts_ptr);
+ params.const_sizes_ptr = wrap(const_sizes_ptr);
+ params.system_values = &system_values;
+ params.inputs = inputs;
+ params.context_ptr = wrap(hPrivateData);
+ params.sampler = sampler;
+ params.info = &swr_fs->info.base;
+
lp_build_tgsi_soa(gallivm,
swr_fs->pipe.tokens,
- lp_type_float_vec(32, 32 * 8),
- uses_mask ? &mask : NULL, // mask
- wrap(consts_ptr),
- wrap(const_sizes_ptr),
- &system_values,
- inputs,
- outputs,
- wrap(hPrivateData),
- NULL, // thread data
- sampler, // sampler
- &swr_fs->info.base,
- NULL, // geometry shader face
- NULL, NULL); //ssbos
+ &params,
+ outputs);
sampler->destroy(sampler);