2022-07-27 15:25:25 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <dawn/native/DawnNative.h>
|
2022-08-02 20:37:56 +00:00
|
|
|
#include <webgpu/webgpu_cpp.h>
|
2022-07-27 15:25:25 +00:00
|
|
|
|
|
|
|
struct SDL_Window;
|
|
|
|
|
|
|
|
namespace aurora::webgpu::utils {
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2022-08-02 20:37:56 +00:00
|
|
|
bool DiscoverAdapter(dawn::native::Instance* instance, SDL_Window* window, wgpu::BackendType type);
|
|
|
|
BackendBinding* CreateBinding(wgpu::BackendType type, SDL_Window* window, WGPUDevice device);
|
2022-07-27 15:25:25 +00:00
|
|
|
|
|
|
|
} // namespace aurora::webgpu::utils
|