#include <epoxy/gl.h>
-#include "imgui.h"
+#include "imgui/imgui.h"
+#include "imgui/imgui_memory_editor.h"
#include "imgui_impl_gtk3.h"
#include "imgui_impl_opengl3.h"
#include "aubinator_viewer.h"
#include "aubinator_viewer_urb.h"
-#include "imgui_memory_editor.h"
struct window {
struct list_head link; /* link in the global list of windows */
window->base.display = display_shader_window;
window->base.destroy = destroy_shader_window;
- struct gen_batch_decode_bo shader_bo;
- if (mem->pml4)
- shader_bo = aub_mem_get_ppgtt_bo(mem, address);
- else
- shader_bo = aub_mem_get_ggtt_bo(mem, address);
-
+ struct gen_batch_decode_bo shader_bo =
+ aub_mem_get_ppgtt_bo(mem, address);
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);
}
}
struct gen_batch_decode_bo ring_bo =
aub_mem_get_ggtt_bo(&window->mem, ring_buffer_start);
assert(ring_bo.size > 0);
- void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - ring_bo.addr);
+ void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - ring_bo.addr) + ring_buffer_head;
window->uses_ppgtt = true;
window->decode_ctx.engine = engine;
aub_viewer_render_batch(&window->decode_ctx, commands,
MIN2(ring_buffer_tail - ring_buffer_head, ring_buffer_length),
- ring_buffer_start);
+ ring_buffer_start + ring_buffer_head);
}
static void
ImGui::ColorEdit3("error", (float *)&cfg->error_color, cflags); ImGui::SameLine();
ImGui::ColorEdit3("highlight", (float *)&cfg->highlight_color, cflags); ImGui::SameLine();
ImGui::ColorEdit3("dwords", (float *)&cfg->dwords_color, cflags); ImGui::SameLine();
+ ImGui::ColorEdit3("booleans", (float *)&cfg->boolean_color, cflags); ImGui::SameLine();
if (ImGui::Button("Commands list") || has_ctrl_key('c')) { show_commands_window(); } ImGui::SameLine();
if (ImGui::Button("Registers list") || has_ctrl_key('r')) { show_register_window(); } ImGui::SameLine();