aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/shader
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-03-30 16:54:08 -0600
committerBrian Paul <[email protected]>2016-03-31 09:48:00 -0600
commit9076e049340db0c55f57abb4ee9bbaffba61d45d (patch)
treef2da10d70e478471028cf0c53d1399e27f2c47ba /src/gallium/drivers/ilo/shader
parent9d7cd439880d9334d21ed099efa15ccf8b709748 (diff)
tgsi: split tgsi_util_get_texture_coord_dim() function into two
It was kind of overloaded, returning two different things. Now get the index of the shadow reference src register with a new tgsi_util_get_shadow_ref_src_index() function. To verify the new code, I added some temp/debug code which looped over all TGSI_TEXTURE_x values, calling the old function and new and checking that the returned indexes matched. Also tested piglit "shadow" tests with softpipe/llvmpipe. No testing of ilo and radeonsi changes. Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ilo/shader')
-rw-r--r--src/gallium/drivers/ilo/shader/ilo_shader_fs.c4
-rw-r--r--src/gallium/drivers/ilo/shader/ilo_shader_vs.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
index f46126e8427..6c8f1b5222e 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
@@ -740,7 +740,9 @@ fs_prepare_tgsi_sampling(struct fs_compile_context *fcc,
break;
}
- num_coords = tgsi_util_get_texture_coord_dim(inst->tex.target, &ref_pos);
+ num_coords = tgsi_util_get_texture_coord_dim(inst->tex.target);
+ ref_pos = tgsi_util_get_shadow_ref_src_index(inst->tex.target);
+
tsrc_transpose(inst->src[0], coords);
bias_or_lod = tsrc_null();
ref_or_si = tsrc_null();
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
index 0df0afc706b..2b46d44f5be 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
@@ -407,7 +407,8 @@ vs_prepare_tgsi_sampling(struct vs_compile_context *vcc,
num_derivs = 0;
sampler_src = 1;
- num_coords = tgsi_util_get_texture_coord_dim(inst->tex.target, &ref_pos);
+ num_coords = tgsi_util_get_texture_coord_dim(inst->tex.target);
+ ref_pos = tgsi_util_get_shadow_ref_src_index(inst->tex.target);
/* extract the parameters */
switch (inst->opcode) {