Rewrite host GPU abstraction

- Don't have to repeat the same thing for 4 renderers.
 - Add native Metal renderer.
This commit is contained in:
Stenzek
2023-08-13 13:42:02 +10:00
parent bfa792ddbf
commit e3d9ba4c99
249 changed files with 28851 additions and 32222 deletions

View File

@@ -3,8 +3,10 @@
#pragma once
#include "util/gpu_device.h"
#include "common/types.h"
#include "util/host_display.h"
#include <functional>
#include <memory>
#include <optional>
@@ -24,6 +26,7 @@ public:
virtual void SetDefaultConfig(SettingsInterface& si) = 0;
virtual bool CreatePlatformWindow(std::string title) = 0;
virtual bool HasPlatformWindow() const = 0;
virtual void DestroyPlatformWindow() = 0;
virtual std::optional<WindowInfo> GetPlatformWindowInfo() = 0;
@@ -46,20 +49,19 @@ public:
#ifdef _WIN32
static std::unique_ptr<NoGUIPlatform> CreateWin32Platform();
#endif
#ifdef __APPLE__
static std::unique_ptr<NoGUIPlatform> CreateCocoaPlatform();
#endif
#ifdef NOGUI_PLATFORM_WAYLAND
static std::unique_ptr<NoGUIPlatform> CreateWaylandPlatform();
#endif
#ifdef NOGUI_PLATFORM_X11
static std::unique_ptr<NoGUIPlatform> CreateX11Platform();
#endif
#ifdef NOGUI_PLATFORM_VTY
static std::unique_ptr<NoGUIPlatform> CreateVTYPlatform();
#endif
protected:
static constexpr s32 DEFAULT_WINDOW_WIDTH = 1280;
static constexpr s32 DEFAULT_WINDOW_HEIGHT = 720;
};
extern std::unique_ptr<NoGUIPlatform> g_nogui_window;
extern std::unique_ptr<NoGUIPlatform> g_nogui_window;