tgsi/ureg: Add a function to return the number of outputs
authorZack Rusin <zackr@vmware.com>
Wed, 24 Apr 2013 03:36:40 +0000 (23:36 -0400)
committerZack Rusin <zackr@vmware.com>
Sat, 27 Apr 2013 03:05:45 +0000 (23:05 -0400)
We already hold the variable, just weren't providing access
to it.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_ureg.c
src/gallium/auxiliary/tgsi/tgsi_ureg.h

index 782f4495fa3b299261977e7673fd649f6435ffa4..5a28b89b58ea8c3201a2bab737e39d628e5e1ac7 100644 (file)
@@ -1767,6 +1767,15 @@ no_ureg:
 }
 
 
+const unsigned
+ureg_get_nr_outputs( const struct ureg_program *ureg )
+{
+   if (!ureg)
+      return 0;
+   return ureg->nr_outputs;
+}
+
+
 void ureg_destroy( struct ureg_program *ureg )
 {
    unsigned i;
index be99ae0f048d406d016f7859a2dd7af35096c9b6..4ad0242e5f3084131ec94c2098807621d29310f9 100644 (file)
@@ -111,6 +111,12 @@ const struct tgsi_token *
 ureg_get_tokens( struct ureg_program *ureg,
                  unsigned *nr_tokens );
 
+/*
+ * Returns the number of currently declared outputs.
+ */
+const unsigned
+ureg_get_nr_outputs( const struct ureg_program *ureg );
+
 
 /* Free the tokens created by ureg_get_tokens() */
 void ureg_free_tokens( const struct tgsi_token *tokens );