OSDN Git Service

gallivm: add information about different sampler/view units if analyzing shader
authorRoland Scheidegger <sroland@vmware.com>
Fri, 19 Sep 2014 17:11:22 +0000 (19:11 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 20 Sep 2014 00:19:02 +0000 (02:19 +0200)
Useful to know in some cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c

index 85411ce..029ca3c 100644 (file)
@@ -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;
index fcaa201..55acea8 100644 (file)
@@ -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) {