Settings: Add GPU adapter option and hook up to D3D11/Vulkan

This commit is contained in:
Connor McLaughlin
2020-06-20 03:33:57 +10:00
parent 1b5f8db2fc
commit 77291096db
23 changed files with 150 additions and 93 deletions

View File

@ -8,9 +8,10 @@
#include <d3d11.h>
#include <dxgi.h>
#include <memory>
#include <wrl/client.h>
#include <vector>
#include <string>
#include <string_view>
#include <vector>
#include <wrl/client.h>
namespace FrontendCommon {
@ -27,7 +28,8 @@ public:
ALWAYS_INLINE void* GetRenderDevice() const { return m_device.Get(); }
ALWAYS_INLINE void* GetRenderContext() const { return m_context.Get(); }
bool CreateContextAndSwapChain(const WindowInfo& wi, bool use_flip_model, bool debug_device);
bool CreateContextAndSwapChain(const WindowInfo& wi, std::string_view adapter_name, bool use_flip_model,
bool debug_device);
bool HasContext() const;
void DestroyContext();
@ -67,6 +69,8 @@ public:
private:
static constexpr u32 DISPLAY_UNIFORM_BUFFER_SIZE = 16;
static std::vector<std::string> EnumerateAdapterNames(IDXGIFactory* dxgi_factory);
bool CreateSwapChain(const WindowInfo& new_wi, bool use_flip_model);
bool CreateSwapChainRTV();