From 3093ac6f4fe8a4e57bcc0e82adef98806ec1e0d4 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 23 Apr 2013 23:36:40 -0400 Subject: [PATCH] tgsi/ureg: Add a function to return the number of outputs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We already hold the variable, just weren't providing access to it. Signed-off-by: Zack Rusin Reviewed-by: José Fonseca --- 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 782f4495fa3..5a28b89b58e 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 be99ae0f048..4ad0242e5f3 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 ); -- 2.30.2