tgsi: helper for dumping tokens as hex
[mesa.git] / src / gallium / auxiliary / tgsi / tgsi_parse.h
index 36de8807b443a460f377dcd58326bfc64399aeb0..bb2bb0d3d3f8c726001129bf26e99c2ad27a14bf 100644 (file)
@@ -132,8 +132,15 @@ void
 tgsi_parse_token(
    struct tgsi_parse_context *ctx );
 
-unsigned
-tgsi_num_tokens(const struct tgsi_token *tokens);
+static INLINE unsigned
+tgsi_num_tokens(const struct tgsi_token *tokens)
+{
+   struct tgsi_header header = *(const struct tgsi_header *) tokens;
+   return header.HeaderSize + header.BodySize;
+}
+
+void
+tgsi_dump_tokens(const struct tgsi_token *tokens);
 
 struct tgsi_token *
 tgsi_dup_tokens(const struct tgsi_token *tokens);