tgsi/scan: add tgsi_shader_info::msaa_images_declared
authorMarek Olšák <marek.olsak@amd.com>
Fri, 13 Sep 2019 01:09:19 +0000 (21:09 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 9 Oct 2019 21:12:27 +0000 (17:12 -0400)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index e1247c3da2639e9ed58dda1dedaf4ec45870ee4f..0cd4a8883ae735278fdff93586e4967e39e491c2 100644 (file)
@@ -293,6 +293,15 @@ scan_src_operand(struct tgsi_shader_info *info,
        !is_mem_query_inst(fullinst->Instruction.Opcode)) {
       *is_mem_inst = true;
 
+      if (src->Register.File == TGSI_FILE_IMAGE &&
+          (fullinst->Memory.Texture == TGSI_TEXTURE_2D_MSAA ||
+           fullinst->Memory.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA)) {
+         if (src->Register.Indirect)
+            info->msaa_images_declared = info->images_declared;
+         else
+            info->msaa_images_declared |= 1 << src->Register.Index;
+      }
+
       if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_store) {
          info->writes_memory = TRUE;
 
@@ -560,6 +569,14 @@ scan_instruction(struct tgsi_shader_info *info,
          info->writes_memory = TRUE;
 
          if (dst->Register.File == TGSI_FILE_IMAGE) {
+            if (fullinst->Memory.Texture == TGSI_TEXTURE_2D_MSAA ||
+                fullinst->Memory.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA) {
+               if (dst->Register.Indirect)
+                  info->msaa_images_declared = info->images_declared;
+               else
+                  info->msaa_images_declared |= 1 << dst->Register.Index;
+            }
+
             if (dst->Register.Indirect)
                info->images_store = info->images_declared;
             else
index a2938e5fd382f2688a97769618bd38cbd9964466..c446ee5e65a0a8d8cba6890e971cc38fd3fb027f 100644 (file)
@@ -144,6 +144,8 @@ struct tgsi_shader_info
    unsigned num_written_clipdistance;
 
    unsigned images_declared; /**< bitmask of declared images */
+   unsigned msaa_images_declared; /**< bitmask of declared MSAA images */
+
    /**
     * Bitmask indicating which declared image is a buffer.
     */