tgsi/scan: get information about indirect 2D file access
authorMarek Olšák <marek.olsak@amd.com>
Wed, 19 Oct 2016 22:57:07 +0000 (00:57 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 24 Oct 2016 19:41:28 +0000 (21:41 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index 0c810053fe5a3581c30410753fd109ae6452426d..e5edea8657b55c1e4417a0be34c2d1196427e5b6 100644 (file)
@@ -285,6 +285,9 @@ scan_instruction(struct tgsi_shader_info *info,
          }
       }
 
+      if (src->Register.Dimension && src->Dimension.Indirect)
+         info->dim_indirect_files |= 1u << src->Register.File;
+
       /* Texture samplers */
       if (src->Register.File == TGSI_FILE_SAMPLER) {
          const unsigned index = src->Register.Index;
@@ -338,6 +341,9 @@ scan_instruction(struct tgsi_shader_info *info,
          info->indirect_files_written |= (1 << dst->Register.File);
       }
 
+      if (dst->Register.Dimension && dst->Dimension.Indirect)
+         info->dim_indirect_files |= 1u << dst->Register.File;
+
       if (is_memory_file(dst->Register.File)) {
          assert(fullinst->Instruction.Opcode == TGSI_OPCODE_STORE);
 
index 2e61dc76842dcf9cd05b0150ad1bec5d40da0d45..47528d5f12deffcfb230204412ebac191b46d72e 100644 (file)
@@ -142,6 +142,7 @@ struct tgsi_shader_info
     */
    unsigned indirect_files_read;
    unsigned indirect_files_written;
+   unsigned dim_indirect_files; /**< shader resource indexing */
    unsigned const_buffers_indirect; /**< const buffers using indirect addressing */
 
    unsigned properties[TGSI_PROPERTY_COUNT]; /* index with TGSI_PROPERTY_ */