aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-01-31 17:17:05 +0100
committerMarek Olšák <[email protected]>2015-02-04 14:34:13 +0100
commitf2328ffdc80d0ea817b2f3f802dae6b2210fbfe2 (patch)
treee439e8f620b0bfb73cf98ae09f1f339d34905dd9 /src/gallium/auxiliary/tgsi
parentccbe15f3325d7a6d04d0ea18227a08f53decec16 (diff)
tgsi: add tgsi_get_processor_type helper from radeon
Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c12
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index f2370ed7a06..9cc83830fdc 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -315,3 +315,15 @@ tgsi_dump_tokens(const struct tgsi_token *tokens)
debug_printf("0x%08x,\n", dwords[i]);
debug_printf("};\n");
}
+
+unsigned
+tgsi_get_processor_type(const struct tgsi_token *tokens)
+{
+ struct tgsi_parse_context parse;
+
+ if (tgsi_parse_init( &parse, tokens ) != TGSI_PARSE_OK) {
+ debug_printf("tgsi_parse_init() failed in %s:%i!\n", __func__, __LINE__);
+ return ~0;
+ }
+ return parse.FullHeader.Processor.Processor;
+}
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.h b/src/gallium/auxiliary/tgsi/tgsi_parse.h
index bfcca484576..cd4b2afdb8b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.h
@@ -153,6 +153,8 @@ tgsi_alloc_tokens(unsigned num_tokens);
void
tgsi_free_tokens(const struct tgsi_token *tokens);
+unsigned
+tgsi_get_processor_type(const struct tgsi_token *tokens);
#if defined __cplusplus
}