From 89f03d187251fa46264218ccedb90e2ae2ea1d93 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 22 Jan 2019 13:04:20 +0000 Subject: [PATCH] imgui: make sure our copy of imgui doesn't clash with others in the same process MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Acked-by: Jason Ekstrand +1-by: Mike Lothian +1-by: Tapani Pälli +1-by: Eric Engestrom +1-by: Yurii Kolesnykov +1-by: myfreeweb +1-by: Kenneth Graunke --- src/imgui/imconfig.h | 5 +++++ src/intel/tools/aubinator_viewer.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/imgui/imconfig.h b/src/imgui/imconfig.h index 825505bf070..877eb819237 100644 --- a/src/imgui/imconfig.h +++ b/src/imgui/imconfig.h @@ -13,6 +13,11 @@ #pragma once +// Have each embedded of ImGui define this symbol : +struct ImGuiContext; +extern thread_local ImGuiContext* __MesaImGui; +#define GImGui __MesaImGui + //---- Define assertion handler. Defaults to calling assert(). //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts diff --git a/src/intel/tools/aubinator_viewer.cpp b/src/intel/tools/aubinator_viewer.cpp index 4c11fe4b37d..0c9cb77d703 100644 --- a/src/intel/tools/aubinator_viewer.cpp +++ b/src/intel/tools/aubinator_viewer.cpp @@ -323,6 +323,8 @@ static struct Context { struct window registers_window; } context; +thread_local ImGuiContext* __MesaImGui; + static int map_key(int k) { -- 2.30.2