diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj
index 5f7250afa..7b11526f2 100644
--- a/src/common/common.vcxproj
+++ b/src/common/common.vcxproj
@@ -9,44 +9,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
@@ -73,36 +40,6 @@
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
@@ -111,38 +48,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
@@ -158,44 +65,12 @@
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
- true
-
-
-
- true
-
-
{EE054E08-3799-4A59-A422-18259C105FFD}
diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters
index a89b94d0a..68d64d9be 100644
--- a/src/common/common.vcxproj.filters
+++ b/src/common/common.vcxproj.filters
@@ -5,24 +5,6 @@
-
- gl
-
-
- gl
-
-
- gl
-
-
- d3d11
-
-
- d3d11
-
-
- d3d11
-
@@ -33,47 +15,11 @@
-
- d3d11
-
-
- gl
-
-
- gl
-
-
- gl
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
@@ -86,40 +32,10 @@
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- vulkan
-
-
- vulkan
-
-
- gl
-
@@ -128,27 +44,8 @@
-
-
- gl
-
-
- gl
-
-
- gl
-
-
- d3d11
-
-
- d3d11
-
-
- d3d11
-
@@ -157,43 +54,7 @@
-
- d3d11
-
-
- gl
-
-
- gl
-
-
- gl
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
-
- vulkan
-
@@ -203,61 +64,19 @@
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- d3d12
-
-
- vulkan
-
-
-
- {52487c57-753d-4888-ba26-ed63ab51a234}
-
-
- {30251086-81f3-44f5-add4-7ff9a24098ab}
-
-
- {642ff5eb-af39-4aab-a42f-6eb8188a11d7}
-
{fd4150b0-6f82-4251-ab23-34c25fbc5b5e}
-
- {358e11c4-34af-4169-9a66-ec66342a6a2f}
-
-
-
-
- vulkan
-
\ No newline at end of file
diff --git a/src/common/gl/context_egl_android.cpp b/src/common/gl/context_egl_android.cpp
deleted file mode 100644
index 6ca861f52..000000000
--- a/src/common/gl/context_egl_android.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
-// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-
-#include "context_egl_android.h"
-#include "../log.h"
-#include
-Log_SetChannel(GL::ContextEGLAndroid);
-
-namespace GL {
-ContextEGLAndroid::ContextEGLAndroid(const WindowInfo& wi) : ContextEGL(wi) {}
-ContextEGLAndroid::~ContextEGLAndroid() = default;
-
-std::unique_ptr ContextEGLAndroid::Create(const WindowInfo& wi, const Version* versions_to_try,
- size_t num_versions_to_try)
-{
- std::unique_ptr context = std::make_unique(wi);
- if (!context->Initialize(versions_to_try, num_versions_to_try))
- return nullptr;
-
- return context;
-}
-
-std::unique_ptr ContextEGLAndroid::CreateSharedContext(const WindowInfo& wi)
-{
- std::unique_ptr context = std::make_unique(wi);
- context->m_display = m_display;
-
- if (!context->CreateContextAndSurface(m_version, m_context, false))
- return nullptr;
-
- return context;
-}
-
-EGLNativeWindowType ContextEGLAndroid::GetNativeWindow(EGLConfig config)
-{
- EGLint native_visual_id = 0;
- if (!eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &native_visual_id))
- {
- Log_ErrorPrintf("Failed to get native visual ID");
- return 0;
- }
-
- ANativeWindow_setBuffersGeometry(static_cast(m_wi.window_handle), 0, 0, static_cast(native_visual_id));
- m_wi.surface_width = ANativeWindow_getWidth(static_cast(m_wi.window_handle));
- m_wi.surface_height = ANativeWindow_getHeight(static_cast(m_wi.window_handle));
- return static_cast(m_wi.window_handle);
-}
-} // namespace GL
diff --git a/src/common/gl/context_egl_android.h b/src/common/gl/context_egl_android.h
deleted file mode 100644
index c8241e8ea..000000000
--- a/src/common/gl/context_egl_android.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
-// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-
-#pragma once
-#include "context_egl.h"
-
-namespace GL {
-
-class ContextEGLAndroid final : public ContextEGL
-{
-public:
- ContextEGLAndroid(const WindowInfo& wi);
- ~ContextEGLAndroid() override;
-
- static std::unique_ptr Create(const WindowInfo& wi, const Version* versions_to_try,
- size_t num_versions_to_try);
-
- std::unique_ptr CreateSharedContext(const WindowInfo& wi) override;
-
-protected:
- EGLNativeWindowType GetNativeWindow(EGLConfig config) override;
-};
-
-} // namespace GL
diff --git a/src/common/gl/context_egl_fbdev.cpp b/src/common/gl/context_egl_fbdev.cpp
deleted file mode 100644
index b69fc58bc..000000000
--- a/src/common/gl/context_egl_fbdev.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
-// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-
-#include "context_egl_fbdev.h"
-
-namespace GL {
-ContextEGLFBDev::ContextEGLFBDev(const WindowInfo& wi) : ContextEGL(wi) {}
-ContextEGLFBDev::~ContextEGLFBDev() = default;
-
-std::unique_ptr ContextEGLFBDev::Create(const WindowInfo& wi, const Version* versions_to_try,
- size_t num_versions_to_try)
-{
- std::unique_ptr context = std::make_unique(wi);
- if (!context->Initialize(versions_to_try, num_versions_to_try))
- return nullptr;
-
- return context;
-}
-
-std::unique_ptr ContextEGLFBDev::CreateSharedContext(const WindowInfo& wi)
-{
- std::unique_ptr context = std::make_unique(wi);
- context->m_display = m_display;
-
- if (!context->CreateContextAndSurface(m_version, m_context, false))
- return nullptr;
-
- return context;
-}
-
-EGLNativeWindowType ContextEGLFBDev::GetNativeWindow(EGLConfig config)
-{
- return static_cast(0);
-}
-} // namespace GL
diff --git a/src/common/gl/context_egl_fbdev.h b/src/common/gl/context_egl_fbdev.h
deleted file mode 100644
index 35f5b8cf4..000000000
--- a/src/common/gl/context_egl_fbdev.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
-// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-
-#pragma once
-#include "context_egl.h"
-
-namespace GL {
-
-class ContextEGLFBDev final : public ContextEGL
-{
-public:
- ContextEGLFBDev(const WindowInfo& wi);
- ~ContextEGLFBDev() override;
-
- static std::unique_ptr Create(const WindowInfo& wi, const Version* versions_to_try,
- size_t num_versions_to_try);
-
- std::unique_ptr CreateSharedContext(const WindowInfo& wi) override;
-
-protected:
- EGLNativeWindowType GetNativeWindow(EGLConfig config) override;
-};
-
-} // namespace GL
diff --git a/src/common/gl/context_egl_gbm.cpp b/src/common/gl/context_egl_gbm.cpp
deleted file mode 100644
index 2f8c7de70..000000000
--- a/src/common/gl/context_egl_gbm.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
-// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-
-#include "context_egl_gbm.h"
-#include "../assert.h"
-#include "../log.h"
-#include
-#include
-#include
-Log_SetChannel(GL::ContextEGLGBM);
-
-namespace GL {
-ContextEGLGBM::ContextEGLGBM(const WindowInfo& wi) : ContextEGL(wi)
-{
-#ifdef CONTEXT_EGL_GBM_USE_PRESENT_THREAD
- StartPresentThread();
-#endif
-}
-
-ContextEGLGBM::~ContextEGLGBM()
-{
-#ifdef CONTEXT_EGL_GBM_USE_PRESENT_THREAD
- StopPresentThread();
- Assert(!m_current_present_buffer);
-#endif
-
- m_drm_display.RestoreBuffer();
-
- // We have to destroy the context before the surface/device.
- // Leaving it to the base class would be too late.
- DestroySurface();
- DestroyContext();
-
- while (m_num_buffers > 0)
- {
- Buffer& buffer = m_buffers[--m_num_buffers];
- m_drm_display.RemoveBuffer(buffer.fb_id);
- }
-
- if (m_fb_surface)
- gbm_surface_destroy(m_fb_surface);
-
- if (m_gbm_device)
- gbm_device_destroy(m_gbm_device);
-}
-
-std::unique_ptr ContextEGLGBM::Create(const WindowInfo& wi, const Version* versions_to_try,
- size_t num_versions_to_try)
-{
- std::unique_ptr context = std::make_unique(wi);
- if (!context->CreateDisplay() || !context->CreateGBMDevice() ||
- !context->Initialize(versions_to_try, num_versions_to_try))
- {
- return nullptr;
- }
-
- return context;
-}
-
-std::unique_ptr ContextEGLGBM::CreateSharedContext(const WindowInfo& wi)
-{
- std::unique_ptr context = std::make_unique(wi);
- context->m_display = m_display;
-
- if (!context->CreateContextAndSurface(m_version, m_context, false))
- return nullptr;
-
- return context;
-}
-
-void ContextEGLGBM::ResizeSurface(u32 new_surface_width, u32 new_surface_height)
-{
- ContextEGL::ResizeSurface(new_surface_width, new_surface_height);
-}
-
-bool ContextEGLGBM::CreateGBMDevice()
-{
- Assert(!m_gbm_device);
- m_gbm_device = gbm_create_device(m_drm_display.GetCardFD());
- if (!m_gbm_device)
- {
- Log_ErrorPrintf("gbm_create_device() failed: %d", errno);
- return false;
- }
-
- return true;
-}
-
-bool ContextEGLGBM::CreateDisplay()
-{
- if (!m_drm_display.Initialize(m_wi.surface_width, m_wi.surface_height, m_wi.surface_refresh_rate))
- return false;
-
- m_wi.surface_width = m_drm_display.GetWidth();
- m_wi.surface_height = m_drm_display.GetHeight();
- m_wi.surface_refresh_rate = m_drm_display.GetRefreshRate();
- return true;
-}
-
-bool ContextEGLGBM::SetDisplay()
-{
- if (!eglGetPlatformDisplayEXT)
- {
- Log_ErrorPrintf("eglGetPlatformDisplayEXT() not loaded");
- return false;
- }
-
- m_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, m_gbm_device, nullptr);
- if (!m_display)
- {
- Log_ErrorPrintf("eglGetPlatformDisplayEXT() failed");
- return false;
- }
-
- return true;
-}
-
-EGLNativeWindowType ContextEGLGBM::GetNativeWindow(EGLConfig config)
-{
- EGLint visual_id;
- eglGetConfigAttrib(m_display, config, EGL_NATIVE_VISUAL_ID, &visual_id);
-
- Assert(!m_fb_surface);
- m_fb_surface = gbm_surface_create(m_gbm_device, m_drm_display.GetWidth(), m_drm_display.GetHeight(),
- static_cast(visual_id), GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
- if (!m_fb_surface)
- {
- Log_ErrorPrintf("gbm_surface_create() failed: %d", errno);
- return {};
- }
-
- return (EGLNativeWindowType)((void*)m_fb_surface);
-}
-
-ContextEGLGBM::Buffer* ContextEGLGBM::LockFrontBuffer()
-{
- struct gbm_bo* bo = gbm_surface_lock_front_buffer(m_fb_surface);
-
- Buffer* buffer = nullptr;
- for (u32 i = 0; i < m_num_buffers; i++)
- {
- if (m_buffers[i].bo == bo)
- {
- buffer = &m_buffers[i];
- break;
- }
- }
-
- if (!buffer)
- {
- // haven't tracked this buffer yet
- Assert(m_num_buffers < MAX_BUFFERS);
-
- const u32 width = gbm_bo_get_width(bo);
- const u32 height = gbm_bo_get_height(bo);
- const u32 stride = gbm_bo_get_stride(bo);
- const u32 format = gbm_bo_get_format(bo);
- const u32 handle = gbm_bo_get_handle(bo).u32;
-
- std::optional fb_id = m_drm_display.AddBuffer(width, height, format, handle, stride, 0);
- if (!fb_id.has_value())
- return nullptr;
-
- buffer = &m_buffers[m_num_buffers];
- buffer->bo = bo;
- buffer->fb_id = fb_id.value();
- m_num_buffers++;
- }
-
- return buffer;
-}
-
-void ContextEGLGBM::ReleaseBuffer(Buffer* buffer)
-{
- gbm_surface_release_buffer(m_fb_surface, buffer->bo);
-}
-
-void ContextEGLGBM::PresentBuffer(Buffer* buffer, bool wait_for_vsync)
-{
- m_drm_display.PresentBuffer(buffer->fb_id, wait_for_vsync);
-}
-
-bool ContextEGLGBM::SwapBuffers()
-{
- if (!ContextEGL::SwapBuffers())
- return false;
-
-#ifdef CONTEXT_EGL_GBM_USE_PRESENT_THREAD
- std::unique_lock lock(m_present_mutex);
- m_present_pending.store(true);
- m_present_cv.notify_one();
- if (m_vsync)
- m_present_done_cv.wait(lock, [this]() { return !m_present_pending.load(); });
-#else
- Buffer* front_buffer = LockFrontBuffer();
- if (!front_buffer)
- return false;
-
- PresentSurface(front_buffer, m_vsync && m_last_front_buffer);
-
- if (m_last_front_buffer)
- ReleaseBuffer(m_last_front_buffer);
-
- m_last_front_buffer = front_buffer;
-#endif
-
- return true;
-}
-
-bool ContextEGLGBM::SetSwapInterval(s32 interval)
-{
- if (interval < 0 || interval > 1)
- return false;
-
- std::unique_lock lock(m_present_mutex);
- m_vsync = (interval > 0);
- return true;
-}
-
-std::vector ContextEGLGBM::EnumerateFullscreenModes()
-{
- std::vector modes;
- modes.reserve(m_drm_display.GetModeCount());
- for (u32 i = 0; i < m_drm_display.GetModeCount(); i++)
- {
- modes.push_back(FullscreenModeInfo{m_drm_display.GetModeWidth(i), m_drm_display.GetModeHeight(i),
- m_drm_display.GetModeRefreshRate(i)});
- }
- return modes;
-}
-
-#ifdef CONTEXT_EGL_GBM_USE_PRESENT_THREAD
-
-void ContextEGLGBM::StartPresentThread()
-{
- m_present_thread_shutdown.store(false);
- m_present_thread = std::thread(&ContextEGLGBM::PresentThread, this);
-}
-
-void ContextEGLGBM::StopPresentThread()
-{
- if (!m_present_thread.joinable())
- return;
-
- {
- std::unique_lock lock(m_present_mutex);
- m_present_thread_shutdown.store(true);
- m_present_cv.notify_one();
- }
-
- m_present_thread.join();
-}
-
-void ContextEGLGBM::PresentThread()
-{
- std::unique_lock lock(m_present_mutex);
-
- while (!m_present_thread_shutdown.load())
- {
- m_present_cv.wait(lock);
-
- if (!m_present_pending.load())
- continue;
-
- Buffer* next_buffer = LockFrontBuffer();
- const bool wait_for_vsync = m_vsync && m_current_present_buffer;
-
- lock.unlock();
- PresentBuffer(next_buffer, wait_for_vsync);
- lock.lock();
-
- if (m_current_present_buffer)
- ReleaseBuffer(m_current_present_buffer);
-
- m_current_present_buffer = next_buffer;
- m_present_pending.store(false);
- m_present_done_cv.notify_one();
- }
-
- if (m_current_present_buffer)
- {
- ReleaseBuffer(m_current_present_buffer);
- m_current_present_buffer = nullptr;
- }
-}
-
-#endif
-
-} // namespace GL
diff --git a/src/common/gl/context_egl_gbm.h b/src/common/gl/context_egl_gbm.h
deleted file mode 100644
index 0bc0d8aef..000000000
--- a/src/common/gl/context_egl_gbm.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
-// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-
-#pragma once
-#include "../drm_display.h"
-#include "context_egl.h"
-#include
-#include
-#include
-#include
-#include
-
-#define CONTEXT_EGL_GBM_USE_PRESENT_THREAD 1
-
-namespace GL {
-
-class ContextEGLGBM final : public ContextEGL
-{
-public:
- ContextEGLGBM(const WindowInfo& wi);
- ~ContextEGLGBM() override;
-
- static std::unique_ptr Create(const WindowInfo& wi, const Version* versions_to_try,
- size_t num_versions_to_try);
-
- std::unique_ptr CreateSharedContext(const WindowInfo& wi) override;
- void ResizeSurface(u32 new_surface_width = 0, u32 new_surface_height = 0) override;
-
- bool SwapBuffers() override;
- bool SetSwapInterval(s32 interval) override;
-
- std::vector EnumerateFullscreenModes() override;
-
-protected:
- bool SetDisplay() override;
- EGLNativeWindowType GetNativeWindow(EGLConfig config) override;
-
-private:
- enum : u32
- {
- MAX_BUFFERS = 5
- };
-
- struct Buffer
- {
- struct gbm_bo* bo;
- u32 fb_id;
- };
-
- bool CreateDisplay();
-
- bool CreateGBMDevice();
- Buffer* LockFrontBuffer();
- void ReleaseBuffer(Buffer* buffer);
- void PresentBuffer(Buffer* buffer, bool wait_for_vsync);
-
- void StartPresentThread();
- void StopPresentThread();
- void PresentThread();
-
- DRMDisplay m_drm_display;
- struct gbm_device* m_gbm_device = nullptr;
- struct gbm_surface* m_fb_surface = nullptr;
- bool m_vsync = true;
-
-#ifdef CONTEXT_EGL_GBM_USE_PRESENT_THREAD
- std::thread m_present_thread;
- std::mutex m_present_mutex;
- std::condition_variable m_present_cv;
- std::atomic_bool m_present_pending{false};
- std::atomic_bool m_present_thread_shutdown{false};
- std::condition_variable m_present_done_cv;
-
- Buffer* m_current_present_buffer = nullptr;
-#endif
-
- u32 m_num_buffers = 0;
- std::array m_buffers{};
-};
-
-} // namespace GL
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj
index a07ce3903..f5fdc3e4f 100644
--- a/src/core/core.vcxproj
+++ b/src/core/core.vcxproj
@@ -33,6 +33,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -52,7 +106,6 @@
true
-
@@ -105,6 +158,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,7 +238,6 @@
-
@@ -157,6 +268,12 @@
+
+
+ true
+
+
+
{868B98C8-65A1-494B-8346-250A73A48C0A}
diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters
index 871da6173..d4666b47e 100644
--- a/src/core/core.vcxproj.filters
+++ b/src/core/core.vcxproj.filters
@@ -35,7 +35,6 @@
-
@@ -60,6 +59,138 @@
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu\d3d11
+
+
+ gpu\d3d11
+
+
+ gpu\d3d11
+
+
+ gpu\d3d11
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
@@ -86,7 +217,6 @@
-
@@ -127,5 +257,171 @@
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu\d3d11
+
+
+ gpu\d3d11
+
+
+ gpu\d3d11
+
+
+ gpu\d3d11
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\d3d12
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\gl
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu\vulkan
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+ gpu
+
+
+
+
+ {7b18fac1-ee2b-4816-8537-eb8f32d40ada}
+
+
+ {f5b7a4af-72c7-406f-b787-9036115c3580}
+
+
+ {17c2f89b-5cf4-4d3a-9343-a03c1c668b85}
+
+
+ {e2aeacc6-65aa-4110-bef9-5f3e1fc0470e}
+
+
+ {e4809e3b-2adc-440a-82df-044a408409b3}
+
+
+
+
+ gpu\gl
+
+
+ gpu\vulkan
+
\ No newline at end of file
diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp
index d099a2be4..2e4ef286b 100644
--- a/src/core/gpu.cpp
+++ b/src/core/gpu.cpp
@@ -7,8 +7,8 @@
#include "common/log.h"
#include "common/string_util.h"
#include "dma.h"
+#include "gpu/gpu_device.h"
#include "host.h"
-#include "host_display.h"
#include "imgui.h"
#include "interrupt_controller.h"
#include "settings.h"
diff --git a/src/core/gpu.h b/src/core/gpu.h
index 75ac564ec..89d4a9bdb 100644
--- a/src/core/gpu.h
+++ b/src/core/gpu.h
@@ -17,7 +17,7 @@
class StateWrapper;
-class HostDisplay;
+class GPUDevice;
class GPUTexture;
class TimingEvent;
diff --git a/src/common/d3d11/shader_cache.cpp b/src/core/gpu/d3d11/shader_cache.cpp
similarity index 99%
rename from src/common/d3d11/shader_cache.cpp
rename to src/core/gpu/d3d11/shader_cache.cpp
index b1c9b5c0e..6bd1112fd 100644
--- a/src/common/d3d11/shader_cache.cpp
+++ b/src/core/gpu/d3d11/shader_cache.cpp
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "shader_cache.h"
-#include "../file_system.h"
-#include "../log.h"
-#include "../md5_digest.h"
+#include "common/file_system.h"
+#include "common/log.h"
+#include "common/md5_digest.h"
#include "shader_compiler.h"
#include
Log_SetChannel(D3D11::ShaderCache);
diff --git a/src/common/d3d11/shader_cache.h b/src/core/gpu/d3d11/shader_cache.h
similarity index 96%
rename from src/common/d3d11/shader_cache.h
rename to src/core/gpu/d3d11/shader_cache.h
index a608cda7a..325211b1f 100644
--- a/src/common/d3d11/shader_cache.h
+++ b/src/core/gpu/d3d11/shader_cache.h
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
-#include "../hash_combine.h"
-#include "../types.h"
-#include "../windows_headers.h"
+#include "common/hash_combine.h"
+#include "common/types.h"
+#include "common/windows_headers.h"
#include "shader_compiler.h"
#include
#include
diff --git a/src/common/d3d11/shader_compiler.cpp b/src/core/gpu/d3d11/shader_compiler.cpp
similarity index 97%
rename from src/common/d3d11/shader_compiler.cpp
rename to src/core/gpu/d3d11/shader_compiler.cpp
index 197361064..fd9f3e4f3 100644
--- a/src/common/d3d11/shader_compiler.cpp
+++ b/src/core/gpu/d3d11/shader_compiler.cpp
@@ -1,9 +1,9 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
+// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "shader_compiler.h"
-#include "../log.h"
-#include "../string_util.h"
+#include "common/log.h"
+#include "common/string_util.h"
#include
#include
#include
diff --git a/src/common/d3d11/shader_compiler.h b/src/core/gpu/d3d11/shader_compiler.h
similarity index 94%
rename from src/common/d3d11/shader_compiler.h
rename to src/core/gpu/d3d11/shader_compiler.h
index 176c45158..98935b810 100644
--- a/src/common/d3d11/shader_compiler.h
+++ b/src/core/gpu/d3d11/shader_compiler.h
@@ -1,8 +1,8 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
+// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
-#include "../windows_headers.h"
+#include "common/windows_headers.h"
#include
#include
#include
diff --git a/src/common/d3d11/stream_buffer.cpp b/src/core/gpu/d3d11/stream_buffer.cpp
similarity index 97%
rename from src/common/d3d11/stream_buffer.cpp
rename to src/core/gpu/d3d11/stream_buffer.cpp
index ad39eb95f..762cde57b 100644
--- a/src/common/d3d11/stream_buffer.cpp
+++ b/src/core/gpu/d3d11/stream_buffer.cpp
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "stream_buffer.h"
-#include "../align.h"
-#include "../assert.h"
-#include "../log.h"
+#include "common/align.h"
+#include "common/assert.h"
+#include "common/log.h"
Log_SetChannel(D3D11);
namespace D3D11 {
diff --git a/src/common/d3d11/stream_buffer.h b/src/core/gpu/d3d11/stream_buffer.h
similarity index 93%
rename from src/common/d3d11/stream_buffer.h
rename to src/core/gpu/d3d11/stream_buffer.h
index aac81b93b..b13862d49 100644
--- a/src/common/d3d11/stream_buffer.h
+++ b/src/core/gpu/d3d11/stream_buffer.h
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
-#include "../types.h"
-#include "../windows_headers.h"
+#include "common/types.h"
+#include "common/windows_headers.h"
#include
#include
@@ -26,7 +26,7 @@ public:
bool Create(ID3D11Device* device, D3D11_BIND_FLAG bind_flags, u32 size);
void Adopt(ComPtr buffer);
void Release();
-
+
struct MappingResult
{
void* pointer;
@@ -44,4 +44,4 @@ private:
u32 m_position;
bool m_use_map_no_overwrite = false;
};
-} // namespace GL
\ No newline at end of file
+} // namespace D3D11
\ No newline at end of file
diff --git a/src/common/d3d11/texture.cpp b/src/core/gpu/d3d11/texture.cpp
similarity index 99%
rename from src/common/d3d11/texture.cpp
rename to src/core/gpu/d3d11/texture.cpp
index df2d3f599..39213adb1 100644
--- a/src/common/d3d11/texture.cpp
+++ b/src/core/gpu/d3d11/texture.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "texture.h"
-#include "../log.h"
+#include "common/log.h"
#include
Log_SetChannel(D3D11);
diff --git a/src/common/d3d11/texture.h b/src/core/gpu/d3d11/texture.h
similarity index 97%
rename from src/common/d3d11/texture.h
rename to src/core/gpu/d3d11/texture.h
index 6060387af..21741b08a 100644
--- a/src/common/d3d11/texture.h
+++ b/src/core/gpu/d3d11/texture.h
@@ -3,7 +3,7 @@
#pragma once
#include "../gpu_texture.h"
-#include "../windows_headers.h"
+#include "common/windows_headers.h"
#include
#include
diff --git a/src/frontend-common/d3d11_host_display.cpp b/src/core/gpu/d3d11_gpu_device.cpp
similarity index 88%
rename from src/frontend-common/d3d11_host_display.cpp
rename to src/core/gpu/d3d11_gpu_device.cpp
index e28e17212..201f5796e 100644
--- a/src/frontend-common/d3d11_host_display.cpp
+++ b/src/core/gpu/d3d11_gpu_device.cpp
@@ -1,16 +1,15 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
-#include "d3d11_host_display.h"
+#include "d3d11_gpu_device.h"
+#include "../host_settings.h"
+#include "../settings.h"
+#include "../shader_cache_version.h"
#include "common/assert.h"
-#include "common/d3d11/shader_cache.h"
-#include "common/d3d11/shader_compiler.h"
#include "common/log.h"
#include "common/string_util.h"
-#include "common_host.h"
-#include "core/host_settings.h"
-#include "core/settings.h"
-#include "core/shader_cache_version.h"
+#include "d3d11/shader_cache.h"
+#include "d3d11/shader_compiler.h"
#include "display_ps.hlsl.h"
#include "display_ps_alpha.hlsl.h"
#include "display_vs.hlsl.h"
@@ -19,16 +18,16 @@
#include "postprocessing_shadergen.h"
#include
#include
-Log_SetChannel(D3D11HostDisplay);
+Log_SetChannel(D3D11GPUDevice);
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "dxgi.lib")
static constexpr std::array s_clear_color = {};
-D3D11HostDisplay::D3D11HostDisplay() = default;
+D3D11GPUDevice::D3D11GPUDevice() = default;
-D3D11HostDisplay::~D3D11HostDisplay()
+D3D11GPUDevice::~D3D11GPUDevice()
{
DestroyStagingBuffer();
DestroyResources();
@@ -37,34 +36,34 @@ D3D11HostDisplay::~D3D11HostDisplay()
m_device.Reset();
}
-RenderAPI D3D11HostDisplay::GetRenderAPI() const
+RenderAPI D3D11GPUDevice::GetRenderAPI() const
{
return RenderAPI::D3D11;
}
-void* D3D11HostDisplay::GetDevice() const
+void* D3D11GPUDevice::GetDevice() const
{
return m_device.Get();
}
-void* D3D11HostDisplay::GetContext() const
+void* D3D11GPUDevice::GetContext() const
{
return m_context.Get();
}
-bool D3D11HostDisplay::HasDevice() const
+bool D3D11GPUDevice::HasDevice() const
{
return static_cast(m_device);
}
-bool D3D11HostDisplay::HasSurface() const
+bool D3D11GPUDevice::HasSurface() const
{
return static_cast(m_swap_chain);
}
-std::unique_ptr D3D11HostDisplay::CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
- GPUTexture::Format format, const void* data,
- u32 data_stride, bool dynamic /* = false */)
+std::unique_ptr D3D11GPUDevice::CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
+ GPUTexture::Format format, const void* data, u32 data_stride,
+ bool dynamic /* = false */)
{
std::unique_ptr tex(std::make_unique());
if (!tex->Create(m_device.Get(), width, height, layers, levels, samples, format, D3D11_BIND_SHADER_RESOURCE, data,
@@ -76,7 +75,7 @@ std::unique_ptr D3D11HostDisplay::CreateTexture(u32 width, u32 heigh
return tex;
}
-bool D3D11HostDisplay::BeginTextureUpdate(GPUTexture* texture, u32 width, u32 height, void** out_buffer, u32* out_pitch)
+bool D3D11GPUDevice::BeginTextureUpdate(GPUTexture* texture, u32 width, u32 height, void** out_buffer, u32* out_pitch)
{
D3D11::Texture* tex = static_cast(texture);
if (!tex->IsDynamic() || tex->GetWidth() != width || tex->GetHeight() != height)
@@ -95,26 +94,26 @@ bool D3D11HostDisplay::BeginTextureUpdate(GPUTexture* texture, u32 width, u32 he
return true;
}
-void D3D11HostDisplay::EndTextureUpdate(GPUTexture* texture, u32 x, u32 y, u32 width, u32 height)
+void D3D11GPUDevice::EndTextureUpdate(GPUTexture* texture, u32 x, u32 y, u32 width, u32 height)
{
D3D11::Texture* tex = static_cast(texture);
m_context->Unmap(tex->GetD3DTexture(), 0);
}
-bool D3D11HostDisplay::UpdateTexture(GPUTexture* texture, u32 x, u32 y, u32 width, u32 height, const void* data,
- u32 pitch)
+bool D3D11GPUDevice::UpdateTexture(GPUTexture* texture, u32 x, u32 y, u32 width, u32 height, const void* data,
+ u32 pitch)
{
D3D11::Texture* tex = static_cast(texture);
if (tex->IsDynamic())
- return HostDisplay::UpdateTexture(texture, x, y, width, height, data, pitch);
+ return GPUDevice::UpdateTexture(texture, x, y, width, height, data, pitch);
const CD3D11_BOX dst_box(x, y, 0, x + width, y + height, 1);
m_context->UpdateSubresource(tex->GetD3DTexture(), 0, &dst_box, data, pitch, pitch * height);
return true;
}
-bool D3D11HostDisplay::DownloadTexture(GPUTexture* texture, u32 x, u32 y, u32 width, u32 height, void* out_data,
- u32 out_data_stride)
+bool D3D11GPUDevice::DownloadTexture(GPUTexture* texture, u32 x, u32 y, u32 width, u32 height, void* out_data,
+ u32 out_data_stride)
{
const D3D11::Texture* tex = static_cast(texture);
if (!CheckStagingBufferSize(width, height, tex->GetDXGIFormat()))
@@ -138,7 +137,7 @@ bool D3D11HostDisplay::DownloadTexture(GPUTexture* texture, u32 x, u32 y, u32 wi
return true;
}
-bool D3D11HostDisplay::CheckStagingBufferSize(u32 width, u32 height, DXGI_FORMAT format)
+bool D3D11GPUDevice::CheckStagingBufferSize(u32 width, u32 height, DXGI_FORMAT format)
{
if (m_readback_staging_texture_width >= width && m_readback_staging_texture_width >= height &&
m_readback_staging_texture_format == format)
@@ -157,7 +156,7 @@ bool D3D11HostDisplay::CheckStagingBufferSize(u32 width, u32 height, DXGI_FORMAT
return true;
}
-void D3D11HostDisplay::DestroyStagingBuffer()
+void D3D11GPUDevice::DestroyStagingBuffer()
{
m_readback_staging_texture.Reset();
m_readback_staging_texture_width = 0;
@@ -165,7 +164,7 @@ void D3D11HostDisplay::DestroyStagingBuffer()
m_readback_staging_texture_format = DXGI_FORMAT_UNKNOWN;
}
-bool D3D11HostDisplay::SupportsTextureFormat(GPUTexture::Format format) const
+bool D3D11GPUDevice::SupportsTextureFormat(GPUTexture::Format format) const
{
const DXGI_FORMAT dfmt = D3D11::Texture::GetDXGIFormat(format);
if (dfmt == DXGI_FORMAT_UNKNOWN)
@@ -176,7 +175,7 @@ bool D3D11HostDisplay::SupportsTextureFormat(GPUTexture::Format format) const
return (SUCCEEDED(m_device->CheckFormatSupport(dfmt, &support)) && ((support & required) == required));
}
-bool D3D11HostDisplay::GetHostRefreshRate(float* refresh_rate)
+bool D3D11GPUDevice::GetHostRefreshRate(float* refresh_rate)
{
if (m_swap_chain && IsFullscreen())
{
@@ -192,15 +191,15 @@ bool D3D11HostDisplay::GetHostRefreshRate(float* refresh_rate)
}
}
- return HostDisplay::GetHostRefreshRate(refresh_rate);
+ return GPUDevice::GetHostRefreshRate(refresh_rate);
}
-void D3D11HostDisplay::SetVSync(bool enabled)
+void D3D11GPUDevice::SetVSync(bool enabled)
{
m_vsync_enabled = enabled;
}
-bool D3D11HostDisplay::CreateDevice(const WindowInfo& wi, bool vsync)
+bool D3D11GPUDevice::CreateDevice(const WindowInfo& wi, bool vsync)
{
UINT create_flags = 0;
if (g_settings.gpu_use_debug_device)
@@ -320,7 +319,7 @@ bool D3D11HostDisplay::CreateDevice(const WindowInfo& wi, bool vsync)
return true;
}
-bool D3D11HostDisplay::SetupDevice()
+bool D3D11GPUDevice::SetupDevice()
{
if (!CreateResources())
return false;
@@ -328,17 +327,17 @@ bool D3D11HostDisplay::SetupDevice()
return true;
}
-bool D3D11HostDisplay::MakeCurrent()
+bool D3D11GPUDevice::MakeCurrent()
{
return true;
}
-bool D3D11HostDisplay::DoneCurrent()
+bool D3D11GPUDevice::DoneCurrent()
{
return true;
}
-bool D3D11HostDisplay::CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode)
+bool D3D11GPUDevice::CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode)
{
HRESULT hr;
@@ -408,7 +407,7 @@ bool D3D11HostDisplay::CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode)
return CreateSwapChainRTV();
}
-bool D3D11HostDisplay::CreateSwapChainRTV()
+bool D3D11GPUDevice::CreateSwapChainRTV()
{
ComPtr backbuffer;
HRESULT hr = m_swap_chain->GetBuffer(0, IID_PPV_ARGS(backbuffer.GetAddressOf()));
@@ -453,7 +452,7 @@ bool D3D11HostDisplay::CreateSwapChainRTV()
return true;
}
-bool D3D11HostDisplay::ChangeWindow(const WindowInfo& new_wi)
+bool D3D11GPUDevice::ChangeWindow(const WindowInfo& new_wi)
{
DestroySurface();
@@ -461,7 +460,7 @@ bool D3D11HostDisplay::ChangeWindow(const WindowInfo& new_wi)
return CreateSwapChain(nullptr);
}
-void D3D11HostDisplay::DestroySurface()
+void D3D11GPUDevice::DestroySurface()
{
m_window_info.SetSurfaceless();
if (IsFullscreen())
@@ -471,7 +470,7 @@ void D3D11HostDisplay::DestroySurface()
m_swap_chain.Reset();
}
-void D3D11HostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
+void D3D11GPUDevice::ResizeWindow(s32 new_window_width, s32 new_window_height)
{
if (!m_swap_chain)
return;
@@ -487,18 +486,18 @@ void D3D11HostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
Panic("Failed to recreate swap chain RTV after resize");
}
-bool D3D11HostDisplay::SupportsFullscreen() const
+bool D3D11GPUDevice::SupportsFullscreen() const
{
return true;
}
-bool D3D11HostDisplay::IsFullscreen()
+bool D3D11GPUDevice::IsFullscreen()
{
BOOL is_fullscreen = FALSE;
return (m_swap_chain && SUCCEEDED(m_swap_chain->GetFullscreenState(&is_fullscreen, nullptr)) && is_fullscreen);
}
-bool D3D11HostDisplay::SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate)
+bool D3D11GPUDevice::SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate)
{
if (!m_swap_chain)
return false;
@@ -560,7 +559,7 @@ bool D3D11HostDisplay::SetFullscreen(bool fullscreen, u32 width, u32 height, flo
return true;
}
-bool D3D11HostDisplay::CreateResources()
+bool D3D11GPUDevice::CreateResources()
{
HRESULT hr;
@@ -631,9 +630,9 @@ bool D3D11HostDisplay::CreateResources()
return true;
}
-void D3D11HostDisplay::DestroyResources()
+void D3D11GPUDevice::DestroyResources()
{
- HostDisplay::DestroyResources();
+ GPUDevice::DestroyResources();
m_post_processing_chain.ClearStages();
m_post_processing_input_texture.Destroy();
@@ -651,23 +650,23 @@ void D3D11HostDisplay::DestroyResources()
m_display_rasterizer_state.Reset();
}
-bool D3D11HostDisplay::CreateImGuiContext()
+bool D3D11GPUDevice::CreateImGuiContext()
{
return ImGui_ImplDX11_Init(m_device.Get(), m_context.Get());
}
-void D3D11HostDisplay::DestroyImGuiContext()
+void D3D11GPUDevice::DestroyImGuiContext()
{
ImGui_ImplDX11_Shutdown();
}
-bool D3D11HostDisplay::UpdateImGuiFontTexture()
+bool D3D11GPUDevice::UpdateImGuiFontTexture()
{
ImGui_ImplDX11_CreateFontsTexture();
return true;
}
-bool D3D11HostDisplay::Render(bool skip_present)
+bool D3D11GPUDevice::Render(bool skip_present)
{
if (skip_present || !m_swap_chain)
{
@@ -705,8 +704,8 @@ bool D3D11HostDisplay::Render(bool skip_present)
return true;
}
-bool D3D11HostDisplay::RenderScreenshot(u32 width, u32 height, const Common::Rectangle& draw_rect,
- std::vector* out_pixels, u32* out_stride, GPUTexture::Format* out_format)
+bool D3D11GPUDevice::RenderScreenshot(u32 width, u32 height, const Common::Rectangle& draw_rect,
+ std::vector* out_pixels, u32* out_stride, GPUTexture::Format* out_format)
{
static constexpr GPUTexture::Format hdformat = GPUTexture::Format::RGBA8;
@@ -747,13 +746,13 @@ bool D3D11HostDisplay::RenderScreenshot(u32 width, u32 height, const Common::Rec
return true;
}
-void D3D11HostDisplay::RenderImGui()
+void D3D11GPUDevice::RenderImGui()
{
ImGui::Render();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
}
-void D3D11HostDisplay::RenderDisplay()
+void D3D11GPUDevice::RenderDisplay()
{
const auto [left, top, width, height] = CalculateDrawRect(GetWindowWidth(), GetWindowHeight());
@@ -777,9 +776,9 @@ void D3D11HostDisplay::RenderDisplay()
IsUsingLinearFiltering());
}
-void D3D11HostDisplay::RenderDisplay(s32 left, s32 top, s32 width, s32 height, D3D11::Texture* texture,
- s32 texture_view_x, s32 texture_view_y, s32 texture_view_width,
- s32 texture_view_height, bool linear_filter)
+void D3D11GPUDevice::RenderDisplay(s32 left, s32 top, s32 width, s32 height, D3D11::Texture* texture,
+ s32 texture_view_x, s32 texture_view_y, s32 texture_view_width,
+ s32 texture_view_height, bool linear_filter)
{
m_context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
m_context->VSSetShader(m_display_vertex_shader.Get(), nullptr, 0);
@@ -810,7 +809,7 @@ void D3D11HostDisplay::RenderDisplay(s32 left, s32 top, s32 width, s32 height, D
m_context->Draw(3, 0);
}
-void D3D11HostDisplay::RenderSoftwareCursor()
+void D3D11GPUDevice::RenderSoftwareCursor()
{
if (!HasSoftwareCursor())
return;
@@ -819,7 +818,7 @@ void D3D11HostDisplay::RenderSoftwareCursor()
RenderSoftwareCursor(left, top, width, height, m_cursor_texture.get());
}
-void D3D11HostDisplay::RenderSoftwareCursor(s32 left, s32 top, s32 width, s32 height, GPUTexture* texture_handle)
+void D3D11GPUDevice::RenderSoftwareCursor(s32 left, s32 top, s32 width, s32 height, GPUTexture* texture_handle)
{
m_context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
m_context->VSSetShader(m_display_vertex_shader.Get(), nullptr, 0);
@@ -843,7 +842,7 @@ void D3D11HostDisplay::RenderSoftwareCursor(s32 left, s32 top, s32 width, s32 he
m_context->Draw(3, 0);
}
-HostDisplay::AdapterAndModeList D3D11HostDisplay::StaticGetAdapterAndModeList()
+GPUDevice::AdapterAndModeList D3D11GPUDevice::StaticGetAdapterAndModeList()
{
ComPtr dxgi_factory;
HRESULT hr = CreateDXGIFactory(IID_PPV_ARGS(dxgi_factory.GetAddressOf()));
@@ -853,7 +852,7 @@ HostDisplay::AdapterAndModeList D3D11HostDisplay::StaticGetAdapterAndModeList()
return GetAdapterAndModeList(dxgi_factory.Get());
}
-HostDisplay::AdapterAndModeList D3D11HostDisplay::GetAdapterAndModeList(IDXGIFactory* dxgi_factory)
+GPUDevice::AdapterAndModeList D3D11GPUDevice::GetAdapterAndModeList(IDXGIFactory* dxgi_factory)
{
AdapterAndModeList adapter_info;
ComPtr current_adapter;
@@ -921,12 +920,12 @@ HostDisplay::AdapterAndModeList D3D11HostDisplay::GetAdapterAndModeList(IDXGIFac
return adapter_info;
}
-HostDisplay::AdapterAndModeList D3D11HostDisplay::GetAdapterAndModeList()
+GPUDevice::AdapterAndModeList D3D11GPUDevice::GetAdapterAndModeList()
{
return GetAdapterAndModeList(m_dxgi_factory.Get());
}
-bool D3D11HostDisplay::SetPostProcessingChain(const std::string_view& config)
+bool D3D11GPUDevice::SetPostProcessingChain(const std::string_view& config)
{
if (config.empty())
{
@@ -983,7 +982,7 @@ bool D3D11HostDisplay::SetPostProcessingChain(const std::string_view& config)
return true;
}
-bool D3D11HostDisplay::CheckPostProcessingRenderTargets(u32 target_width, u32 target_height)
+bool D3D11GPUDevice::CheckPostProcessingRenderTargets(u32 target_width, u32 target_height)
{
DebugAssert(!m_post_processing_stages.empty());
@@ -1014,10 +1013,10 @@ bool D3D11HostDisplay::CheckPostProcessingRenderTargets(u32 target_width, u32 ta
return true;
}
-void D3D11HostDisplay::ApplyPostProcessingChain(ID3D11RenderTargetView* final_target, s32 final_left, s32 final_top,
- s32 final_width, s32 final_height, D3D11::Texture* texture,
- s32 texture_view_x, s32 texture_view_y, s32 texture_view_width,
- s32 texture_view_height, u32 target_width, u32 target_height)
+void D3D11GPUDevice::ApplyPostProcessingChain(ID3D11RenderTargetView* final_target, s32 final_left, s32 final_top,
+ s32 final_width, s32 final_height, D3D11::Texture* texture,
+ s32 texture_view_x, s32 texture_view_y, s32 texture_view_width,
+ s32 texture_view_height, u32 target_width, u32 target_height)
{
if (!CheckPostProcessingRenderTargets(target_width, target_height))
{
@@ -1074,7 +1073,7 @@ void D3D11HostDisplay::ApplyPostProcessingChain(ID3D11RenderTargetView* final_ta
m_context->PSSetShaderResources(0, 1, &null_srv);
}
-bool D3D11HostDisplay::CreateTimestampQueries()
+bool D3D11GPUDevice::CreateTimestampQueries()
{
for (u32 i = 0; i < NUM_TIMESTAMP_QUERIES; i++)
{
@@ -1094,7 +1093,7 @@ bool D3D11HostDisplay::CreateTimestampQueries()
return true;
}
-void D3D11HostDisplay::DestroyTimestampQueries()
+void D3D11GPUDevice::DestroyTimestampQueries()
{
if (!m_timestamp_queries[0][0])
return;
@@ -1109,7 +1108,7 @@ void D3D11HostDisplay::DestroyTimestampQueries()
m_timestamp_query_started = 0;
}
-void D3D11HostDisplay::PopTimestampQuery()
+void D3D11GPUDevice::PopTimestampQuery()
{
while (m_waiting_timestamp_queries > 0)
{
@@ -1155,7 +1154,7 @@ void D3D11HostDisplay::PopTimestampQuery()
}
}
-void D3D11HostDisplay::KickTimestampQuery()
+void D3D11GPUDevice::KickTimestampQuery()
{
if (m_timestamp_query_started || !m_timestamp_queries[0][0] || m_waiting_timestamp_queries == NUM_TIMESTAMP_QUERIES)
return;
@@ -1165,7 +1164,7 @@ void D3D11HostDisplay::KickTimestampQuery()
m_timestamp_query_started = true;
}
-bool D3D11HostDisplay::SetGPUTimingEnabled(bool enabled)
+bool D3D11GPUDevice::SetGPUTimingEnabled(bool enabled)
{
if (m_gpu_timing_enabled == enabled)
return true;
@@ -1186,7 +1185,7 @@ bool D3D11HostDisplay::SetGPUTimingEnabled(bool enabled)
}
}
-float D3D11HostDisplay::GetAndResetAccumulatedGPUTime()
+float D3D11GPUDevice::GetAndResetAccumulatedGPUTime()
{
const float value = m_accumulated_gpu_time;
m_accumulated_gpu_time = 0.0f;
diff --git a/src/frontend-common/d3d11_host_display.h b/src/core/gpu/d3d11_gpu_device.h
similarity index 95%
rename from src/frontend-common/d3d11_host_display.h
rename to src/core/gpu/d3d11_gpu_device.h
index f6c4f725c..27d788ff9 100644
--- a/src/frontend-common/d3d11_host_display.h
+++ b/src/core/gpu/d3d11_gpu_device.h
@@ -2,13 +2,13 @@
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
-#include "common/d3d11/stream_buffer.h"
-#include "common/d3d11/texture.h"
#include "common/timer.h"
#include "common/window_info.h"
#include "common/windows_headers.h"
-#include "core/host_display.h"
-#include "frontend-common/postprocessing_chain.h"
+#include "d3d11/stream_buffer.h"
+#include "d3d11/texture.h"
+#include "gpu_device.h"
+#include "postprocessing_chain.h"
#include
#include
#include
@@ -17,14 +17,14 @@
#include
#include
-class D3D11HostDisplay final : public HostDisplay
+class D3D11GPUDevice final : public GPUDevice
{
public:
template
using ComPtr = Microsoft::WRL::ComPtr;
- D3D11HostDisplay();
- ~D3D11HostDisplay();
+ D3D11GPUDevice();
+ ~D3D11GPUDevice();
RenderAPI GetRenderAPI() const override;
void* GetDevice() const override;
diff --git a/src/common/d3d12/context.cpp b/src/core/gpu/d3d12/context.cpp
similarity index 99%
rename from src/common/d3d12/context.cpp
rename to src/core/gpu/d3d12/context.cpp
index 186b1b30b..1d4514ba7 100644
--- a/src/common/d3d12/context.cpp
+++ b/src/core/gpu/d3d12/context.cpp
@@ -1,11 +1,11 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
+// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
// Parts originally from Dolphin Emulator, also written by myself.
#include "context.h"
-#include "../assert.h"
-#include "../log.h"
-#include "../scoped_guard.h"
+#include "common/assert.h"
+#include "common/log.h"
+#include "common/scoped_guard.h"
#include
#include
#include
diff --git a/src/common/d3d12/context.h b/src/core/gpu/d3d12/context.h
similarity index 97%
rename from src/common/d3d12/context.h
rename to src/core/gpu/d3d12/context.h
index 8bdc8e99b..dcad6d1c3 100644
--- a/src/common/d3d12/context.h
+++ b/src/core/gpu/d3d12/context.h
@@ -1,11 +1,11 @@
-// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin
+// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
// Parts originally from Dolphin Emulator, also written by myself.
#pragma once
-#include "../types.h"
-#include "../windows_headers.h"
+#include "common/types.h"
+#include "common/windows_headers.h"
#include "descriptor_heap_manager.h"
#include "stream_buffer.h"
#include
diff --git a/src/common/d3d12/descriptor_heap_manager.cpp b/src/core/gpu/d3d12/descriptor_heap_manager.cpp
similarity index 98%
rename from src/common/d3d12/descriptor_heap_manager.cpp
rename to src/core/gpu/d3d12/descriptor_heap_manager.cpp
index ca215fc62..20956a9f4 100644
--- a/src/common/d3d12/descriptor_heap_manager.cpp
+++ b/src/core/gpu/d3d12/descriptor_heap_manager.cpp
@@ -3,8 +3,8 @@
// Parts originally from Dolphin Emulator, also written by myself.
#include "descriptor_heap_manager.h"
-#include "../assert.h"
-#include "../log.h"
+#include "common/assert.h"
+#include "common/log.h"
#include "context.h"
Log_SetChannel(DescriptorHeapManager);
diff --git a/src/common/d3d12/descriptor_heap_manager.h b/src/core/gpu/d3d12/descriptor_heap_manager.h
similarity index 97%
rename from src/common/d3d12/descriptor_heap_manager.h
rename to src/core/gpu/d3d12/descriptor_heap_manager.h
index c5ad8267b..b05034ae4 100644
--- a/src/common/d3d12/descriptor_heap_manager.h
+++ b/src/core/gpu/d3d12/descriptor_heap_manager.h
@@ -4,8 +4,8 @@
#pragma once
-#include "../types.h"
-#include "../windows_headers.h"
+#include "common/types.h"
+#include "common/windows_headers.h"
#include
#include
#include