tgsi: add clip and cull distance writemasks into tgsi_shader_info
authorMarek Olšák <marek.olsak@amd.com>
Sun, 7 Dec 2014 18:08:28 +0000 (19:08 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 10 Dec 2014 20:59:36 +0000 (21:59 +0100)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index b6c88af3a9e079b2892bcbeee2daeabdd6e5af6d..9d155c908f5ae9916e0d351f250d6004fe2ab035 100644 (file)
@@ -227,10 +227,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                      if (semName == TGSI_SEMANTIC_CLIPDIST) {
                         info->num_written_clipdistance +=
                            util_bitcount(fulldecl->Declaration.UsageMask);
+                        info->clipdist_writemask |=
+                           fulldecl->Declaration.UsageMask << (semIndex*4);
                      }
                      else if (semName == TGSI_SEMANTIC_CULLDIST) {
                         info->num_written_culldistance +=
                            util_bitcount(fulldecl->Declaration.UsageMask);
+                        info->culldist_writemask |=
+                           fulldecl->Declaration.UsageMask << (semIndex*4);
                      }
                      else if (semName == TGSI_SEMANTIC_VIEWPORT_INDEX) {
                         info->writes_viewport_index = TRUE;
index b50b650c8016e34248f593f41019d37f61ad3aa5..56079977bf1e6c060a117561cc0165a039b3210d 100644 (file)
@@ -81,6 +81,8 @@ struct tgsi_shader_info
    boolean writes_layer;
    boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
 
+   unsigned clipdist_writemask;
+   unsigned culldist_writemask;
    unsigned num_written_culldistance;
    unsigned num_written_clipdistance;
    /**