[Mesa-dev] [PATCH] tgsi/ureg: Add a function to return the number of outputs
Zack Rusin
zackr at vmware.com
Tue Apr 23 20:37:22 PDT 2013
We already hold the variable, just weren't providing access
to it.
Signed-off-by: Zack Rusin <zackr at vmware.com>
---
src/gallium/auxiliary/tgsi/tgsi_ureg.c | 9 +++++++++
src/gallium/auxiliary/tgsi/tgsi_ureg.h | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 782f449..5a28b89 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -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;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index be99ae0..4ad0242 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -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 );
--
1.7.10.4
More information about the mesa-dev
mailing list