From: Nicolai Hähnle <nicolai.haeh...@amd.com>

Compute the count since the start of the current line instead of the
count since the start of the the disassembly.
---
 src/gallium/drivers/radeonsi/si_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index 835eedd89e6..2186938fec9 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5176,21 +5176,21 @@ static void si_shader_dump_disassembly(struct si_screen 
*screen,
                 * parsing of resulting logs.
                 */
                pipe_debug_message(debug, SHADER_INFO,
                                   "Shader Disassembly Begin");
 
                uint64_t line = 0;
                while (line < nbytes) {
                        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,
                                                   "%.*s", count, disasm + 
line);
                        }
 
                        line += count + 1;
                }
 
                pipe_debug_message(debug, SHADER_INFO,
-- 
2.20.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to