[Mesa-dev] [PATCH v2 11/11] intel: add aubinator ui

Eric Engestrom eric.engestrom at imgtec.com
Fri Nov 3 19:06:28 UTC 2017


On Wednesday, 2017-11-01 18:12:18 +0000, Lionel Landwerlin wrote:
> The motivation for building this UI is to help debug the intel
> drivers. It can be tricky to figure what is going wrong in the
> emission of commands (figuring out if there is an off by one error in
> the sampler state pointers for example or if you accidently override
> some bits of memory). Going through the text output of aubinator can
> be quite tedious (time consuming and error prone), as you need to go
> back and forth several pages of dumps to build a mental model of the
> state of the GPU for a given draw call. This calls for a better way to
> display/search an aubdump.
> 
> This UI is mostly based off the original aubinator code. It's using
> the ImGui toolkit [1]. Being an immediate mode UI toolkit, it makes
> the code of the original aubinator pretty easy to reuse/port to
> generate a UI.
> 
> This also adds an interesting feature which collects the GPU state by
> walking the instruction stream and "snapshotting" the last sets of
> commands allowing to present what would be the state of the GPU at a
> given point (right now it only snapshots on 3DPRIMITIVE commands).
> 
> Some screenshots :
>     https://i.imgur.com/0JTLkTo.png
>     https://i.imgur.com/ABq31XD.png
> 
> Although the UI toolkit isn't tied to any of the main toolkit (like
> Gtk+, Qt, etc...), we still require a connection to the desktop
> display. The ImGui backend currently used is built on Gtk+ & Cogl. The
> choice of Gtk+ is mostly due to having UI scaling working properly on
> wayland/x11 (on hidpi screens). Cogl mostly because it's more
> convenient that raw GL. Of course this could be revisited.
> 
> [1] : https://github.com/ocornut/imgui
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> 
> For the autotools part:
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  configure.ac                                   |    16 +
>  meson.build                                    |     7 +
>  meson_options.txt                              |     6 +
>  src/intel/Makefile.tools.am                    |    58 +
>  src/intel/tools/.gitignore                     |     2 +
>  src/intel/tools/aubinator_imgui_widgets.cpp    |   183 +
>  src/intel/tools/aubinator_imgui_widgets.h      |    12 +
>  src/intel/tools/aubinator_ui.cpp               |  3174 +++++++
>  src/intel/tools/imgui/LICENSE.txt              |    21 +
>  src/intel/tools/imgui/imconfig.h               |    57 +
>  src/intel/tools/imgui/imgui.cpp                | 10725 +++++++++++++++++++++++
>  src/intel/tools/imgui/imgui.h                  |  1516 ++++
>  src/intel/tools/imgui/imgui_demo.cpp           |  2827 ++++++
>  src/intel/tools/imgui/imgui_draw.cpp           |  2673 ++++++
>  src/intel/tools/imgui/imgui_impl_gtk3_cogl.cpp |   784 ++
>  src/intel/tools/imgui/imgui_impl_gtk3_cogl.h   |    27 +
>  src/intel/tools/imgui/imgui_internal.h         |   864 ++
>  src/intel/tools/imgui/stb_rect_pack.h          |   583 ++
>  src/intel/tools/imgui/stb_textedit.h           |  1322 +++
>  src/intel/tools/imgui/stb_truetype.h           |  4018 +++++++++
>  src/intel/tools/memory.c                       |   545 ++
>  src/intel/tools/memory.h                       |    55 +
>  src/intel/tools/meson.build                    |    30 +
>  23 files changed, 29505 insertions(+)
>  create mode 100644 src/intel/tools/aubinator_imgui_widgets.cpp
>  create mode 100644 src/intel/tools/aubinator_imgui_widgets.h
>  create mode 100644 src/intel/tools/aubinator_ui.cpp
>  create mode 100644 src/intel/tools/imgui/LICENSE.txt
>  create mode 100644 src/intel/tools/imgui/imconfig.h
>  create mode 100644 src/intel/tools/imgui/imgui.cpp
>  create mode 100644 src/intel/tools/imgui/imgui.h
>  create mode 100644 src/intel/tools/imgui/imgui_demo.cpp
>  create mode 100644 src/intel/tools/imgui/imgui_draw.cpp
>  create mode 100644 src/intel/tools/imgui/imgui_impl_gtk3_cogl.cpp
>  create mode 100644 src/intel/tools/imgui/imgui_impl_gtk3_cogl.h
>  create mode 100644 src/intel/tools/imgui/imgui_internal.h
>  create mode 100644 src/intel/tools/imgui/stb_rect_pack.h
>  create mode 100644 src/intel/tools/imgui/stb_textedit.h
>  create mode 100644 src/intel/tools/imgui/stb_truetype.h
>  create mode 100644 src/intel/tools/memory.c
>  create mode 100644 src/intel/tools/memory.h
> 
[snip]
> diff --git a/meson.build b/meson.build
> index 6ad8c8bbf4b..86b1af3e4e3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -43,6 +43,7 @@ pre_args = [
>  with_vulkan_icd_dir = get_option('vulkan-icd-dir')
>  with_tests = get_option('build-tests')
>  with_valgrind = get_option('valgrind')
> +with_intel_tools = get_option('intel-tools')
>  with_libunwind = get_option('libunwind')
>  with_asm = get_option('asm')
>  with_llvm = get_option('llvm')
> @@ -700,6 +701,12 @@ else
>    dep_valgrind = []
>  endif
>  
> +dep_aubinator_ui = [
> +  dependency('gtk+-3.0', version: '>= 3.20.0'),
> +  dependency('cogl-2.0-experimental', version: '>= 1.18.0'),
> +]
> +with_intel_tools = get_option('intel-tools') and dep_aubinator_ui[0].found() and dep_aubinator_ui[1].found()
> +
>  # pthread stubs. Lets not and say we didn't
>  
>  prog_bison = find_program('bison', required : with_any_opengl)
> diff --git a/meson_options.txt b/meson_options.txt
> index d93dd6eab2a..9109cd9dfde 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -182,3 +182,9 @@ option(
>    choices : ['8', '16', '32'],
>    description : 'Number of channel bits for OSMesa.'
>  )
> +option(
> +  'intel-tools',
> +  type : 'boolean',
> +  value : true,
> +  description : 'Build intel tools if possible'
> +)
[snip]
> diff --git a/src/intel/tools/meson.build b/src/intel/tools/meson.build
> index 1996d5208f0..e62abce99b0 100644
> --- a/src/intel/tools/meson.build
> +++ b/src/intel/tools/meson.build
> @@ -28,6 +28,27 @@ aubinator = executable(
>    build_by_default : false,
>  )
>  
> +if with_intel_tools
> +  inc_imgui = include_directories('imgui')
> +  aubinator_ui = executable(
> +    'aubinator_ui',
> +    files('aubinator_ui.cpp',
> +          'aubinator_imgui_widgets.cpp',
> +          'imgui/imgui.cpp',
> +          'imgui/imgui_demo.cpp',
> +          'imgui/imgui_draw.cpp',
> +          'imgui/imgui_impl_gtk3_cogl.cpp',
> +          'memory.c',
> +          'disasm.c',),
> +    dependencies : [dep_aubinator_ui, dep_expat, dep_zlib, dep_dl, dep_thread, dep_m],
> +    include_directories : [inc_common, inc_intel, inc_imgui],
> +    link_with : [libisl, libintel_common, libintel_compiler, libmesa_util],
> +    c_args : [c_vis_args, no_override_init_args],
> +    cpp_args : cpp_vis_args,
> +    build_by_default : false,
> +  )
> +endif
> +
>  aubinator_error_decode = executable(
>    'aubinator_error_decode',
>    files('aubinator_error_decode.c', 'disasm.c', 'gen_disasm.h'),
> @@ -37,3 +58,12 @@ aubinator_error_decode = executable(
>    c_args : [c_vis_args, no_override_init_args],
>    build_by_default : false,
>  )
> +
> +memory_tests = executable(
> +  'memory_tests',
> +  files('memory.c'),
> +  include_directories : inc_common,
> +  link_with : libmesa_util,
> +  c_args : [c_vis_args, no_override_init_args, '-DBUILD_TESTS'],
> +  build_by_default : false,
> +)

Did you want to make this a test maybe?

test('memory',
  executable(...)
)

Other than that, the meson bits look good to me:
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

> -- 
> 2.15.0
> 


More information about the mesa-dev mailing list