mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
dawn_native: Factor getting procs into a single function.
Now the backends only expose the creation of devices. Getting the procs is moved to DawnNative that will over time more backend-agnostic APIs.
This commit is contained in:
committed by
Corentin Wallez
parent
f9f44ae289
commit
dcb71a131c
@@ -53,15 +53,14 @@ namespace utils {
|
||||
void SetupGLFWWindowHints() override {
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
||||
}
|
||||
void GetProcAndDevice(dawnProcTable* procs, dawnDevice* device) override {
|
||||
dawnDevice CreateDevice() override {
|
||||
uint32_t extensionCount = 0;
|
||||
const char** glfwInstanceExtensions =
|
||||
glfwGetRequiredInstanceExtensions(&extensionCount);
|
||||
std::vector<const char*> requiredExtensions(glfwInstanceExtensions,
|
||||
glfwInstanceExtensions + extensionCount);
|
||||
|
||||
dawn_native::vulkan::Init(procs, device, requiredExtensions);
|
||||
mDevice = *device;
|
||||
return dawn_native::vulkan::CreateDevice(requiredExtensions);
|
||||
}
|
||||
uint64_t GetSwapChainImplementation() override {
|
||||
if (mSwapchainImpl.userData == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user