intel/aub_viewer: highlight true booleans

Useful to spot PIPE_CONTROL flags.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
Lionel Landwerlin 2018-11-18 17:25:46 +00:00
parent 6ba61ea391
commit f7bccf6ab4
3 changed files with 10 additions and 2 deletions

View file

@ -993,6 +993,7 @@ display_aubfile_window(struct window *win)
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();

View file

@ -12,13 +12,15 @@ struct aub_viewer_cfg {
ImColor highlight_color;
ImColor error_color;
ImColor missing_color;
ImColor boolean_color;
aub_viewer_cfg() :
clear_color(114, 144, 154),
dwords_color(29, 177, 194, 255),
highlight_color(0, 230, 0, 255),
error_color(236, 255, 0, 255),
missing_color(230, 0, 230, 255) {}
missing_color(230, 0, 230, 255),
boolean_color(228, 75, 255) {}
};
struct aub_viewer_decode_cfg {

View file

@ -74,7 +74,12 @@ aub_viewer_print_group(struct aub_viewer_decode_ctx *ctx,
}
if (!gen_field_is_header(iter.field)) {
if (ctx->decode_cfg->field_filter.PassFilter(iter.name)) {
ImGui::Text("%s: %s", iter.name, iter.value);
if (iter.field->type.kind == gen_type::GEN_TYPE_BOOL && iter.raw_value) {
ImGui::Text("%s: ", iter.name); ImGui::SameLine();
ImGui::TextColored(ctx->cfg->boolean_color, "true");
} else {
ImGui::Text("%s: %s", iter.name, iter.value);
}
if (iter.struct_desc) {
int struct_dword = iter.start_bit / 32;
uint64_t struct_address = address + 4 * struct_dword;