mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 15:46:28 +00:00
dawn_native: Fixup namespace from backend:: to dawn_native::
This commit is contained in:
committed by
Corentin Wallez
parent
30965a7729
commit
49a65d0c0c
@@ -21,13 +21,13 @@
|
||||
#define GLFW_EXPOSE_NATIVE_WIN32
|
||||
#include "GLFW/glfw3native.h"
|
||||
|
||||
namespace backend { namespace d3d12 {
|
||||
namespace dawn_native { namespace d3d12 {
|
||||
void Init(dawnProcTable* procs, dawnDevice* device);
|
||||
|
||||
dawnSwapChainImplementation CreateNativeSwapChainImpl(dawnDevice device, HWND window);
|
||||
dawnTextureFormat GetNativeSwapChainPreferredFormat(
|
||||
const dawnSwapChainImplementation* swapChain);
|
||||
}} // namespace backend::d3d12
|
||||
}} // namespace dawn_native::d3d12
|
||||
|
||||
namespace utils {
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace utils {
|
||||
}
|
||||
|
||||
void GetProcAndDevice(dawnProcTable* procs, dawnDevice* device) override {
|
||||
backend::d3d12::Init(procs, device);
|
||||
dawn_native::d3d12::Init(procs, device);
|
||||
mBackendDevice = *device;
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@ namespace utils {
|
||||
if (mSwapchainImpl.userData == nullptr) {
|
||||
HWND win32Window = glfwGetWin32Window(mWindow);
|
||||
mSwapchainImpl =
|
||||
backend::d3d12::CreateNativeSwapChainImpl(mBackendDevice, win32Window);
|
||||
dawn_native::d3d12::CreateNativeSwapChainImpl(mBackendDevice, win32Window);
|
||||
}
|
||||
return reinterpret_cast<uint64_t>(&mSwapchainImpl);
|
||||
}
|
||||
|
||||
dawnTextureFormat GetPreferredSwapChainTextureFormat() override {
|
||||
ASSERT(mSwapchainImpl.userData != nullptr);
|
||||
return backend::d3d12::GetNativeSwapChainPreferredFormat(&mSwapchainImpl);
|
||||
return dawn_native::d3d12::GetNativeSwapChainPreferredFormat(&mSwapchainImpl);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#import <Metal/Metal.h>
|
||||
#import <QuartzCore/CAMetalLayer.h>
|
||||
|
||||
namespace backend { namespace metal {
|
||||
namespace dawn_native { namespace metal {
|
||||
void Init(id<MTLDevice> metalDevice, dawnProcTable* procs, dawnDevice* device);
|
||||
void SetNextDrawable(dawnDevice device, id<CAMetalDrawable> drawable);
|
||||
void Present(dawnDevice device);
|
||||
@@ -117,7 +117,7 @@ namespace utils {
|
||||
void GetProcAndDevice(dawnProcTable* procs, dawnDevice* device) override {
|
||||
mMetalDevice = MTLCreateSystemDefaultDevice();
|
||||
|
||||
backend::metal::Init(mMetalDevice, procs, device);
|
||||
dawn_native::metal::Init(mMetalDevice, procs, device);
|
||||
mBackendDevice = *device;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
#include "utils/BackendBinding.h"
|
||||
|
||||
namespace backend { namespace null {
|
||||
namespace dawn_native { namespace null {
|
||||
void Init(dawnProcTable* procs, dawnDevice* device);
|
||||
}} // namespace backend::null
|
||||
}} // namespace dawn_native::null
|
||||
|
||||
namespace utils {
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace utils {
|
||||
void SetupGLFWWindowHints() override {
|
||||
}
|
||||
void GetProcAndDevice(dawnProcTable* procs, dawnDevice* device) override {
|
||||
backend::null::Init(procs, device);
|
||||
dawn_native::null::Init(procs, device);
|
||||
}
|
||||
uint64_t GetSwapChainImplementation() override {
|
||||
return 0;
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#include <cstdio>
|
||||
#include "GLFW/glfw3.h"
|
||||
|
||||
namespace backend { namespace opengl {
|
||||
namespace dawn_native { namespace opengl {
|
||||
void Init(void* (*getProc)(const char*), dawnProcTable* procs, dawnDevice* device);
|
||||
}} // namespace backend::opengl
|
||||
}} // namespace dawn_native::opengl
|
||||
|
||||
namespace utils {
|
||||
class SwapChainImplGL {
|
||||
@@ -113,8 +113,8 @@ namespace utils {
|
||||
}
|
||||
void GetProcAndDevice(dawnProcTable* procs, dawnDevice* device) override {
|
||||
glfwMakeContextCurrent(mWindow);
|
||||
backend::opengl::Init(reinterpret_cast<void* (*)(const char*)>(glfwGetProcAddress),
|
||||
procs, device);
|
||||
dawn_native::opengl::Init(reinterpret_cast<void* (*)(const char*)>(glfwGetProcAddress),
|
||||
procs, device);
|
||||
|
||||
mBackendDevice = *device;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
namespace dawn_native { namespace vulkan {
|
||||
void Init(dawnProcTable* procs,
|
||||
dawnDevice* device,
|
||||
const std::vector<const char*>& requiredInstanceExtensions);
|
||||
@@ -32,7 +32,7 @@ namespace backend { namespace vulkan {
|
||||
dawnSwapChainImplementation CreateNativeSwapChainImpl(dawnDevice device, VkSurfaceKHR surface);
|
||||
dawnTextureFormat GetNativeSwapChainPreferredFormat(
|
||||
const dawnSwapChainImplementation* swapChain);
|
||||
}} // namespace backend::vulkan
|
||||
}} // namespace dawn_native::vulkan
|
||||
|
||||
namespace utils {
|
||||
|
||||
@@ -74,24 +74,24 @@ namespace utils {
|
||||
std::vector<const char*> requiredExtensions(glfwInstanceExtensions,
|
||||
glfwInstanceExtensions + extensionCount);
|
||||
|
||||
backend::vulkan::Init(procs, device, requiredExtensions);
|
||||
dawn_native::vulkan::Init(procs, device, requiredExtensions);
|
||||
mDevice = *device;
|
||||
}
|
||||
uint64_t GetSwapChainImplementation() override {
|
||||
if (mSwapchainImpl.userData == nullptr) {
|
||||
VkSurfaceKHR surface = VK_NULL_HANDLE;
|
||||
if (glfwCreateWindowSurface(backend::vulkan::GetInstance(mDevice), mWindow, nullptr,
|
||||
&surface) != VK_SUCCESS) {
|
||||
if (glfwCreateWindowSurface(dawn_native::vulkan::GetInstance(mDevice), mWindow,
|
||||
nullptr, &surface) != VK_SUCCESS) {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
mSwapchainImpl = backend::vulkan::CreateNativeSwapChainImpl(mDevice, surface);
|
||||
mSwapchainImpl = dawn_native::vulkan::CreateNativeSwapChainImpl(mDevice, surface);
|
||||
}
|
||||
return reinterpret_cast<uint64_t>(&mSwapchainImpl);
|
||||
}
|
||||
dawnTextureFormat GetPreferredSwapChainTextureFormat() override {
|
||||
ASSERT(mSwapchainImpl.userData != nullptr);
|
||||
return backend::vulkan::GetNativeSwapChainPreferredFormat(&mSwapchainImpl);
|
||||
return dawn_native::vulkan::GetNativeSwapChainPreferredFormat(&mSwapchainImpl);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user