From fca2d3ce3fd87e2b5744e1f1d7c0c95814ed86b3 Mon Sep 17 00:00:00 2001 From: Andreas Baierl Date: Mon, 18 Nov 2019 10:03:32 +0100 Subject: [PATCH] lima/streamparser: Add findings introduced with gl_PointSize Reviewed-by: Vasily Khoruzhick Signed-off-by: Andreas Baierl --- src/gallium/drivers/lima/lima_parser.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/lima/lima_parser.c b/src/gallium/drivers/lima/lima_parser.c index 90d98210ad4..5d606bdc24a 100644 --- a/src/gallium/drivers/lima/lima_parser.c +++ b/src/gallium/drivers/lima/lima_parser.c @@ -24,6 +24,7 @@ #include #include +#include #include "lima_parser.h" @@ -236,11 +237,22 @@ parse_plbu_semaphore(FILE *fp, uint32_t *value1, uint32_t *value2) static void parse_plbu_primitive_setup(FILE *fp, uint32_t *value1, uint32_t *value2) { + char prim[10]; + + if ((*value1 & 0x0000f000) == 0x00000000) + strcpy(prim, "POINTS"); + else if ((*value1 & 0x0000f000) == 0x00003000) + strcpy(prim, "LINES"); + else if ((*value1 & 0x0000f000) == 0x00002000) + strcpy(prim, "TRIANGLES"); + else + strcpy(prim, "UNKNOWN"); + if (*value1 == 0x00000200) fprintf(fp, "\t/* UNKNOWN_2 (PRIMITIVE_SETUP INIT?) */\n"); else - fprintf(fp, "\t/* PRIMITIVE_SETUP: low_prim: %s, cull: %d (0x%x), index_size: %d (0x%08x) */\n", - (*value1 & 0x0000f000) == 0x00003000 ? "true" : "false", + fprintf(fp, "\t/* PRIMITIVE_SETUP: prim: %s, cull: %d (0x%x), index_size: %d (0x%08x) */\n", + prim, (*value1 & 0x000f0000) >> 16, (*value1 & 0x000f0000) >> 16, (*value1 & 0x00001e00) >> 9, (*value1 & 0x00001e00) >> 9); } @@ -298,6 +310,12 @@ parse_plbu_indexed_dest(FILE *fp, uint32_t *value1, uint32_t *value2) fprintf(fp, "\t/* INDEXED_DEST: gl_pos: 0x%08x */\n", *value1); } +static void +parse_plbu_indexed_pt_size(FILE *fp, uint32_t *value1, uint32_t *value2) +{ + fprintf(fp, "\t/* INDEXED_PT_SIZE: pt_size: 0x%08x */\n", *value1); +} + static void parse_plbu_indices(FILE *fp, uint32_t *value1, uint32_t *value2) { @@ -364,6 +382,8 @@ lima_parse_plbu(FILE *fp, uint32_t *data, int size, uint32_t start) parse_plbu_indexed_dest(fp, value1, value2); else if ((*value2 & 0xff000fff) == 0x10000101) parse_plbu_indices(fp, value1, value2); + else if ((*value2 & 0xff000fff) == 0x10000102) + parse_plbu_indexed_pt_size(fp, value1, value2); else if ((*value2 & 0xff000fff) == 0x10000105) parse_plbu_viewport_bottom(fp, (float *)value1, value2); else if ((*value2 & 0xff000fff) == 0x10000106) -- 2.30.2