tgsi/scan: track which shader images are really buffers
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 13 Mar 2016 20:06:15 +0000 (15:06 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 21 Mar 2016 20:34:22 +0000 (15:34 -0500)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index dee6884d14d2ceba1ced25b365f09a481ad0c158..65bdab5b1cd51fa9ed19576c6ee71781bf81b6af 100644 (file)
@@ -427,6 +427,9 @@ scan_declaration(struct tgsi_shader_info *info,
          }
       } else if (file == TGSI_FILE_SAMPLER) {
          info->samplers_declared |= 1 << reg;
+      } else if (file == TGSI_FILE_IMAGE) {
+         if (fulldecl->Image.Resource == TGSI_TEXTURE_BUFFER)
+            info->images_buffers |= 1 << reg;
       }
    }
 }
index f52729ae2d27c348131d022835377212301d691b..d777f23749b46a594d16b9e39efe5d1cd71cf54b 100644 (file)
@@ -122,6 +122,10 @@ struct tgsi_shader_info
     * Indirect image accesses are not reflected in this mask.
     */
    unsigned images_writemask;
+   /**
+    * Bitmask indicating which declared image is a buffer.
+    */
+   unsigned images_buffers;
    /**
     * Bitmask indicating which register files are accessed with
     * indirect addressing.  The bits are (1 << TGSI_FILE_x), etc.