intel/aub_viewer: fix shader view
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 19 Dec 2018 17:52:06 +0000 (17:52 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 28 Dec 2018 16:48:40 +0000 (16:48 +0000)
Not decoding the shader at the right offset.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/intel/tools/aubinator_viewer.cpp

index 47eba274daca3f190c3d64c4f1db0f5b93bf11c7..fe936154381502ecdd88a26ece52a3c18d45ba1f 100644 (file)
@@ -392,7 +392,9 @@ new_shader_window(struct aub_mem *mem, uint64_t address, const char *desc)
    if (shader_bo.map) {
       FILE *f = open_memstream(&window->shader, &window->shader_size);
       if (f) {
-         gen_disasm_disassemble(context.file->disasm, shader_bo.map, 0, f);
+         gen_disasm_disassemble(context.file->disasm,
+                                (const uint8_t *) shader_bo.map +
+                                (address - shader_bo.addr), 0, f);
          fclose(f);
       }
    }