metaforce/aurora/lib/dawn/BackendBinding.hpp

28 lines
696 B
C++
Raw Normal View History

2022-02-16 23:13:40 +00:00
#pragma once
#include <dawn/native/DawnNative.h>
#include <dawn/webgpu_cpp.h>
struct SDL_Window;
2022-02-19 05:33:56 +00:00
namespace aurora::gpu::utils {
2022-02-16 23:13:40 +00:00
class BackendBinding {
public:
virtual ~BackendBinding() = default;
virtual uint64_t GetSwapChainImplementation() = 0;
virtual WGPUTextureFormat GetPreferredSwapChainTextureFormat() = 0;
protected:
BackendBinding(SDL_Window* window, WGPUDevice device);
SDL_Window* m_window = nullptr;
WGPUDevice m_device = nullptr;
};
bool DiscoverAdapter(dawn::native::Instance* instance, SDL_Window* window, wgpu::BackendType type);
2022-02-16 23:13:40 +00:00
BackendBinding* CreateBinding(wgpu::BackendType type, SDL_Window* window, WGPUDevice device);
2022-02-19 05:33:56 +00:00
} // namespace aurora::gpu::utils