diff --git a/Qt/QtMain.h b/Qt/QtMain.h index d1bcc87fa..0e511c846 100644 --- a/Qt/QtMain.h +++ b/Qt/QtMain.h @@ -33,9 +33,9 @@ QTM_USE_NAMESPACE #include "base/NKCodeFromQt.h" #include "Common/GraphicsContext.h" -#include "Core/System.h" #include "Core/Core.h" #include "Core/Config.h" +#include "Core/System.h" // Input void SimulateGamepad(); @@ -44,6 +44,7 @@ class QtDummyGraphicsContext : public DummyGraphicsContext { public: QtDummyGraphicsContext() { draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); assert(success); } diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 8e56288e9..acc5cc0e1 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -340,6 +340,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std: // Finally we can do the regular initialization. CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); assert(success); window_ = window; @@ -468,6 +469,7 @@ bool SDLVulkanGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, } draw_ = Draw::T3DCreateVulkanContext(vulkan_, false); + SetGPUBackend(GPUBackend::VULKAN); bool success = draw_->CreatePresets(); assert(success); draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight()); diff --git a/Windows/GPU/D3D11Context.cpp b/Windows/GPU/D3D11Context.cpp index 871b527aa..b8ec01bd4 100644 --- a/Windows/GPU/D3D11Context.cpp +++ b/Windows/GPU/D3D11Context.cpp @@ -10,6 +10,7 @@ #include "Core/Config.h" #include "Core/Reporting.h" +#include "Core/System.h" #include "Windows/GPU/D3D11Context.h" #include "Windows/W32Util/Misc.h" #include "thin3d/thin3d.h" @@ -140,6 +141,7 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { #endif draw_ = Draw::T3DCreateD3D11Context(device_, context_, device1_, context1_, featureLevel_, hWnd_); + SetGPUBackend(GPUBackend::DIRECT3D11); bool success = draw_->CreatePresets(); // If we can run D3D11, there's a compiler installed. I think. assert(success); diff --git a/Windows/GPU/D3D9Context.cpp b/Windows/GPU/D3D9Context.cpp index 4566464a7..19f772fb9 100644 --- a/Windows/GPU/D3D9Context.cpp +++ b/Windows/GPU/D3D9Context.cpp @@ -9,6 +9,7 @@ #include "Core/Config.h" #include "Core/Reporting.h" +#include "Core/System.h" #include "Common/OSVersion.h" #include "Windows/GPU/D3D9Context.h" #include "Windows/W32Util/Misc.h" @@ -165,6 +166,7 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { //deviceEx->SetMaximumFrameLatency(1); } draw_ = Draw::T3DCreateDX9Context(d3d_, d3dEx_, adapterId_, device_, deviceEx_); + SetGPUBackend(GPUBackend::DIRECT3D9); if (!draw_->CreatePresets()) { // Shader compiler not installed? Return an error so we can fall back to GL. device_->Release(); diff --git a/Windows/GPU/WindowsGLContext.cpp b/Windows/GPU/WindowsGLContext.cpp index 418c12fa8..3b9707ca4 100644 --- a/Windows/GPU/WindowsGLContext.cpp +++ b/Windows/GPU/WindowsGLContext.cpp @@ -362,6 +362,7 @@ bool WindowsGLContext::Init(HINSTANCE hInst, HWND window, std::string *error_mes CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); // if we get this far, there will always be a GLSL compiler capable of compiling these. assert(success); CHECK_GL_ERROR_IF_DEBUG(); diff --git a/Windows/GPU/WindowsVulkanContext.cpp b/Windows/GPU/WindowsVulkanContext.cpp index 87ceca553..67e6f5195 100644 --- a/Windows/GPU/WindowsVulkanContext.cpp +++ b/Windows/GPU/WindowsVulkanContext.cpp @@ -51,6 +51,7 @@ #include #include "Core/Config.h" +#include "Core/System.h" #include "Common/Vulkan/VulkanLoader.h" #include "Common/Vulkan/VulkanContext.h" #include "Common/Vulkan/VulkanDebug.h" @@ -131,6 +132,7 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m bool splitSubmit = g_Config.bGfxDebugSplitSubmit; draw_ = Draw::T3DCreateVulkanContext(g_Vulkan, splitSubmit); + SetGPUBackend(GPUBackend::VULKAN); bool success = draw_->CreatePresets(); assert(success); // Doesn't fail, we include the compiler. draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 8c7cf5e59..a06e2125f 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -135,6 +135,7 @@ bool AndroidEGLGraphicsContext::Init(ANativeWindow *wnd, int backbufferWidth, in gl->MakeCurrent(); CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); // There will always be a GLSL compiler capable of compiling these. assert(success); return true; @@ -161,6 +162,7 @@ public: AndroidJavaEGLGraphicsContext() { CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); assert(success); } @@ -339,6 +341,7 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX, bool success = true; if (g_Vulkan->InitObjects()) { draw_ = Draw::T3DCreateVulkanContext(g_Vulkan, g_Config.bGfxDebugSplitSubmit); + SetGPUBackend(GPUBackend::VULKAN); success = draw_->CreatePresets(); // Doesn't fail, we ship the compiler. assert(success); draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); diff --git a/headless/SDLHeadlessHost.cpp b/headless/SDLHeadlessHost.cpp index 1176bef1e..17026f7fc 100644 --- a/headless/SDLHeadlessHost.cpp +++ b/headless/SDLHeadlessHost.cpp @@ -54,6 +54,7 @@ public: GLDummyGraphicsContext() { CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); assert(success); } diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 4c81509ec..528287094 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -21,6 +21,7 @@ #include "gfx_es2/gpu_features.h" #include "Core/Config.h" +#include "Core/System.h" #include "Common/GraphicsContext.h" #include @@ -39,6 +40,7 @@ public: IOSDummyGraphicsContext() { CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); + SetGPUBackend(GPUBackend::OPENGL); bool success = draw_->CreatePresets(); assert(success); }