tgsi: add info about MSAA samplers to tgsi_shader_info
authorMarek Olšák <marek.olsak@amd.com>
Tue, 6 Aug 2013 04:35:23 +0000 (06:35 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 15 Aug 2013 00:03:02 +0000 (02:03 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index 1294a7a98a7028cba95b23e6e545700b95672e48..05b711148ce70a9fc6f915d3e73e2b83fcfe86b9 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "util/u_debug.h"
 #include "util/u_math.h"
+#include "util/u_memory.h"
 #include "util/u_prim.h"
 #include "tgsi/tgsi_parse.h"
 #include "tgsi/tgsi_util.h"
@@ -128,6 +129,18 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                if (src->Register.Indirect) {
                   info->indirect_files |= (1 << src->Register.File);
                }
+
+               /* MSAA samplers */
+               if (src->Register.File == TGSI_FILE_SAMPLER) {
+                  assert(fullinst->Instruction.Texture);
+                  assert(src->Register.Index < Elements(info->is_msaa_sampler));
+
+                  if (fullinst->Instruction.Texture &&
+                      (fullinst->Texture.Texture == TGSI_TEXTURE_2D_MSAA ||
+                       fullinst->Texture.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA)) {
+                     info->is_msaa_sampler[src->Register.Index] = TRUE;
+                  }
+               }
             }
 
             /* check for indirect register writes */
index e2fa73a3fa78eb88640e85c340d52062c98d90d2..d9147bd5bd9af2f39307a680cd3422053ad6c626 100644 (file)
@@ -80,6 +80,7 @@ struct tgsi_shader_info
    boolean color0_writes_all_cbufs;
    boolean writes_viewport_index;
    boolean writes_layer;
+   boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
 
    unsigned num_written_culldistance;
    unsigned num_written_clipdistance;