radeonsi: fix line splitting in si_shader_dump_assembly
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 29 Apr 2019 13:59:22 +0000 (15:59 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 13 Jun 2019 00:28:23 +0000 (20:28 -0400)
Compute the count since the start of the current line instead of the
count since the start of the the disassembly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index ed2db3d0042bad7f7129c6515fcbf49bb4db0ed6..f4e522dd7c1eacecbbef2f7a3b26b580e9b38ffb 100644 (file)
@@ -5259,7 +5259,7 @@ static void si_shader_dump_disassembly(struct si_screen *screen,
                        int count = nbytes - line;
                        const char *nl = memchr(disasm + line, '\n', nbytes - line);
                        if (nl)
-                               count = nl - disasm;
+                               count = nl - (disasm + line);
 
                        if (count) {
                                pipe_debug_message(debug, SHADER_INFO,