diff options
| author | Stenzek <stenzek@gmail.com> | 2018-11-28 23:36:39 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2019-01-25 11:15:57 +1000 |
| commit | 78588ce79dceef745c6931a12ad1e59677346227 (patch) | |
| tree | a2048b676ee24c543a73af3373588814878353b1 /Source/Core/VideoCommon/ShaderCache.cpp | |
| parent | e4b205c76937d379cd9043939e2cef1651b1a21b (diff) | |
ShaderCache: Use imgui for shader compilation dialog
Diffstat (limited to 'Source/Core/VideoCommon/ShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/ShaderCache.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp index 299b0d1bca..3b0c110f96 100644 --- a/Source/Core/VideoCommon/ShaderCache.cpp +++ b/Source/Core/VideoCommon/ShaderCache.cpp @@ -8,7 +8,6 @@ #include "Common/FileUtil.h" #include "Common/MsgHandler.h" #include "Core/ConfigManager.h" -#include "Core/Host.h" #include "VideoCommon/FramebufferManagerBase.h" #include "VideoCommon/RenderBase.h" @@ -16,6 +15,8 @@ #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexManagerBase.h" +#include "imgui.h" + std::unique_ptr<VideoCommon::ShaderCache> g_shader_cache; namespace VideoCommon @@ -153,12 +154,29 @@ void ShaderCache::WaitForAsyncCompiler() while (m_async_shader_compiler->HasPendingWork() || m_async_shader_compiler->HasCompletedWork()) { m_async_shader_compiler->WaitUntilCompletion([](size_t completed, size_t total) { - Host_UpdateProgressDialog(GetStringT("Compiling shaders...").c_str(), - static_cast<int>(completed), static_cast<int>(total)); + g_renderer->BeginUIFrame(); + + const float scale = ImGui::GetIO().DisplayFramebufferScale.x; + + ImGui::SetNextWindowSize(ImVec2(400.0f * scale, 50.0f * scale), ImGuiCond_Always); + ImGui::SetNextWindowPosCenter(ImGuiCond_Always); + if (ImGui::Begin(GetStringT("Compiling Shaders").c_str(), nullptr, + ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs | + ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings | + ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoNav | + ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing)) + { + ImGui::Text("Compiling shaders: %zu/%zu", completed, total); + ImGui::ProgressBar(static_cast<float>(completed) / + static_cast<float>(std::max(total, static_cast<size_t>(1))), + ImVec2(-1.0f, 0.0f), ""); + } + ImGui::End(); + + g_renderer->EndUIFrame(); }); m_async_shader_compiler->RetrieveWorkItems(); } - Host_UpdateProgressDialog("", -1, -1); } template <ShaderStage stage, typename K, typename T> |
