OSDN Git Service

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 dee6884..65bdab5 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 f52729a..d777f23 100644 (file)
@@ -123,6 +123,10 @@ struct tgsi_shader_info
     */
    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.
     */