From 1b1ef6b4573ab9f21abd5fb374bc74d03390146d Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 24 Jul 2015 17:06:01 -0400 Subject: [PATCH] freedreno/ir3: add stream-output support to cmdline compiler A bit hard-coded configuration at the moment, but sufficient for now. Signed-off-by: Rob Clark --- .../drivers/freedreno/ir3/ir3_cmdline.c | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c index 68f08486075..ede29f445dc 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c @@ -93,8 +93,7 @@ static void print_usage(void) printf(" --saturate-s MASK - bitmask of samplers to saturate S coord\n"); printf(" --saturate-t MASK - bitmask of samplers to saturate T coord\n"); printf(" --saturate-r MASK - bitmask of samplers to saturate R coord\n"); - printf(" --nocp - disable copy propagation\n"); - printf(" --nir - use NIR compiler\n"); + printf(" --stream-out - enable stream-out (aka transform feedback)\n"); printf(" --help - show this message\n"); } @@ -114,6 +113,9 @@ int main(int argc, char **argv) fd_mesa_debug |= FD_DBG_DISASM; + memset(&s, 0, sizeof(s)); + memset(&v, 0, sizeof(v)); + /* cmdline args which impact shader variant get spit out in a * comment on the first line.. a quick/dirty way to preserve * that info so when ir3test recompiles the shader with a new @@ -170,6 +172,24 @@ int main(int argc, char **argv) continue; } + if (!strcmp(argv[n], "--stream-out")) { + struct pipe_stream_output_info *so = &s.stream_output; + debug_printf(" %s", argv[n]); + /* TODO more dynamic config based on number of outputs, etc + * rather than just hard-code for first output: + */ + so->num_outputs = 1; + so->stride[0] = 4; + so->output[0].register_index = 0; + so->output[0].start_component = 0; + so->output[0].num_components = 4; + so->output[0].output_buffer = 0; + so->output[0].dst_offset = 2; + so->output[0].stream = 0; + n++; + continue; + } + if (!strcmp(argv[n], "--help")) { print_usage(); return 0; @@ -193,10 +213,8 @@ int main(int argc, char **argv) if (!tgsi_text_translate(ptr, toks, Elements(toks))) errx(1, "could not parse `%s'", filename); - memset(&s, 0, sizeof(s)); s.tokens = toks; - memset(&v, 0, sizeof(v)); v.key = key; v.shader = &s; -- 2.30.2