Dave,
----- Original Message ----- > From: Dave Airlie <airl...@redhat.com> > > Just add support to the scanner to count the number of clip > distances. > > Signed-off-by: Dave Airlie <airl...@redhat.com> > --- > src/gallium/auxiliary/tgsi/tgsi_scan.c | 4 ++++ > src/gallium/auxiliary/tgsi/tgsi_scan.h | 1 + > 2 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c > b/src/gallium/auxiliary/tgsi/tgsi_scan.c > index 97d74e4..d81db89 100644 > --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c > +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c > @@ -191,6 +191,10 @@ tgsi_scan_shader(const struct tgsi_token > *tokens, > info->output_semantic_index[reg] = > (ubyte)fulldecl->Semantic.Index; > info->num_outputs++; > > + if (procType == TGSI_PROCESSOR_VERTEX && > + fulldecl->Semantic.Name == > TGSI_SEMANTIC_CLIPDIST) { > + info->num_clipdistance += > util_bitcount(fulldecl->Declaration.UsageMask); > + } > /* extra info for special outputs */ > if (procType == TGSI_PROCESSOR_FRAGMENT && > fulldecl->Semantic.Name == > TGSI_SEMANTIC_POSITION) > diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h > b/src/gallium/auxiliary/tgsi/tgsi_scan.h > index 482c106..a3d21b0 100644 > --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h > +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h > @@ -75,6 +75,7 @@ struct tgsi_shader_info > boolean pixel_center_integer; > boolean color0_writes_all_cbufs; > > + unsigned num_clipdistance; It would be more self documenting if the variable name implied that this is the number of clip distances written. Maybe "num_output_clipdist" or "num_written_clipdist". Jose _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev