summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2014-09-19 19:11:22 +0200
committerRoland Scheidegger <[email protected]>2014-09-20 02:19:02 +0200
commit7ede5a1a7bd9571cbcfb63a89d1225a638c346f0 (patch)
tree681f1accf3d64e124a2bfd65a87f310f809970dc /src/gallium
parent4824eecc0c6000c485df9865fbfda98142d8fa18 (diff)
gallivm: add information about different sampler/view units if analyzing shader
Useful to know in some cases. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi.h6
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
index 85411ce4817..029ca3c8410 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
@@ -127,6 +127,12 @@ struct lp_tgsi_info
unsigned indirect_textures:1;
/*
+ * Whether any of the texture (sample) ocpodes use different sampler
+ * and sampler view unit.
+ */
+ unsigned sampler_texture_units_different:1;
+
+ /*
* Whether any immediate values are outside the range of 0 and 1
*/
unsigned unclamped_immediates:1;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c
index fcaa20143e6..55acea83799 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c
@@ -243,6 +243,10 @@ analyse_sample(struct analysis_context *ctx,
tex_info->texture_unit = inst->Src[1].Register.Index;
tex_info->sampler_unit = inst->Src[2].Register.Index;
+ if (tex_info->texture_unit != tex_info->sampler_unit) {
+ info->sampler_texture_units_different = TRUE;
+ }
+
if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV ||
modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD ||
modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS || shadow) {