tgsi: keep track of read vs written indirects
authorRob Clark <robclark@freedesktop.org>
Sat, 3 Jan 2015 21:11:28 +0000 (16:11 -0500)
committerRob Clark <robclark@freedesktop.org>
Thu, 8 Jan 2015 00:37:28 +0000 (19:37 -0500)
At least temporarily, I need to fallback to old compiler still for
relative dest (for freedreno), but I can do relative src temp.  Only
a temporary situation, but seems easy/reasonable for tgsi-scan to
track this.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index 6210ebdb3ade017724127247becf0e6381c6c973..9d1f848a9a83345b87bcbe22e7fd292b760b5768 100644 (file)
@@ -130,6 +130,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                /* check for indirect register reads */
                if (src->Register.Indirect) {
                   info->indirect_files |= (1 << src->Register.File);
+                  info->indirect_files_read |= (1 << src->Register.File);
                }
 
                /* MSAA samplers */
@@ -150,6 +151,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                const struct tgsi_full_dst_register *dst = &fullinst->Dst[i];
                if (dst->Register.Indirect) {
                   info->indirect_files |= (1 << dst->Register.File);
+                  info->indirect_files_written |= (1 << dst->Register.File);
                }
             }
 
index bacb4aba24218d652538ef2af529acba40012d57..75540d5732b2611248d8eb2e540fe35296191391 100644 (file)
@@ -94,6 +94,12 @@ struct tgsi_shader_info
     * indirect addressing.  The bits are (1 << TGSI_FILE_x), etc.
     */
    unsigned indirect_files;
+   /**
+    * Bitmask indicating which register files are read / written with
+    * indirect addressing.  The bits are (1 << TGSI_FILE_x).
+    */
+   unsigned indirect_files_read;
+   unsigned indirect_files_written;
 
    unsigned properties[TGSI_PROPERTY_COUNT]; /* index with TGSI_PROPERTY_ */
 };