Skip to content

Commit

Permalink
Merge branch 'main' into dawn
Browse files Browse the repository at this point in the history
  • Loading branch information
eliemichel authored Sep 24, 2024
2 parents 8b69cc2 + 7adcb12 commit c063c16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ FetchContent_Declare(
)
FetchContent_Declare(
webgpu
GIT_REPOSITORY https://github.com/eliemichel/WebGPU-binaries.git
GIT_TAG main
GIT_REPOSITORY https://github.com/eliemichel/WebGPU-distribution.git
GIT_TAG 7ed61fb96d972a4c61ccc79af1139eba2a0ce4c4 # fetch
)
FetchContent_MakeAvailable(glfw-light webgpu)

Expand Down
30 changes: 15 additions & 15 deletions glfw3webgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ WGPUSurface glfwGetWGPUSurface(WGPUInstance instance, GLFWwindow* window) {
Display* x11_display = glfwGetX11Display();
Window x11_window = glfwGetX11Window(window);

#ifdef WEBGPU_BACKEND_DAWN
# ifdef WEBGPU_BACKEND_DAWN
WGPUSurfaceSourceXlibWindow fromXlibWindow;
fromXlibWindow.chain.sType = WGPUSType_SurfaceSourceXlibWindow;
#else
# else
WGPUSurfaceDescriptorFromXlibWindow fromXlibWindow;
fromXlibWindow.chain.sType = WGPUSType_SurfaceDescriptorFromXlibWindow;
#endif
# endif
fromXlibWindow.chain.next = NULL;
fromXlibWindow.display = x11_display;
fromXlibWindow.window = x11_window;
Expand All @@ -94,13 +94,13 @@ WGPUSurface glfwGetWGPUSurface(WGPUInstance instance, GLFWwindow* window) {
struct wl_display* wayland_display = glfwGetWaylandDisplay();
struct wl_surface* wayland_surface = glfwGetWaylandWindow(window);

#ifdef WEBGPU_BACKEND_DAWN
# ifdef WEBGPU_BACKEND_DAWN
WGPUSurfaceSourceWaylandSurface fromWaylandSurface;
fromWaylandSurface.chain.sType = WGPUSType_SurfaceSourceWaylandSurface;
#else
# else
WGPUSurfaceDescriptorFromWaylandSurface fromWaylandSurface;
fromWaylandSurface.chain.sType = WGPUSType_SurfaceDescriptorFromWaylandSurface;
#endif
# endif
fromWaylandSurface.chain.next = NULL;
fromWaylandSurface.display = wayland_display;
fromWaylandSurface.surface = wayland_surface;
Expand All @@ -120,13 +120,13 @@ WGPUSurface glfwGetWGPUSurface(WGPUInstance instance, GLFWwindow* window) {
[ns_window.contentView setWantsLayer : YES] ;
[ns_window.contentView setLayer : metal_layer] ;

#ifdef WEBGPU_BACKEND_DAWN
# ifdef WEBGPU_BACKEND_DAWN
WGPUSurfaceSourceMetalLayer fromMetalLayer;
fromMetalLayer.chain.sType = WGPUSType_SurfaceSourceMetalLayer;
#else
# else
WGPUSurfaceDescriptorFromMetalLayer fromMetalLayer;
fromMetalLayer.chain.sType = WGPUSType_SurfaceDescriptorFromMetalLayer;
#endif
# endif
fromMetalLayer.chain.next = NULL;
fromMetalLayer.layer = metal_layer;

Expand All @@ -143,13 +143,13 @@ WGPUSurface glfwGetWGPUSurface(WGPUInstance instance, GLFWwindow* window) {
HWND hwnd = glfwGetWin32Window(window);
HINSTANCE hinstance = GetModuleHandle(NULL);

#ifdef WEBGPU_BACKEND_DAWN
# ifdef WEBGPU_BACKEND_DAWN
WGPUSurfaceSourceWindowsHWND fromWindowsHWND;
fromWindowsHWND.chain.sType = WGPUSType_SurfaceSourceWindowsHWND;
#else
# else
WGPUSurfaceDescriptorFromWindowsHWND fromWindowsHWND;
fromWindowsHWND.chain.sType = WGPUSType_SurfaceDescriptorFromWindowsHWND;
#endif
# endif
fromWindowsHWND.chain.next = NULL;
fromWindowsHWND.hinstance = hinstance;
fromWindowsHWND.hwnd = hwnd;
Expand All @@ -164,13 +164,13 @@ WGPUSurface glfwGetWGPUSurface(WGPUInstance instance, GLFWwindow* window) {

#ifdef GLFW_EXPOSE_NATIVE_EMSCRIPTEN
case GLFW_PLATFORM_EMSCRIPTEN: {
#ifdef WEBGPU_BACKEND_DAWN
# ifdef WEBGPU_BACKEND_DAWN
WGPUSurfaceSourceCanvasHTMLSelector_Emscripten fromCanvasHTMLSelector;
fromCanvasHTMLSelector.chain.sType = WGPUSType_SurfaceSourceCanvasHTMLSelector_Emscripten;
#else
# else
WGPUSurfaceDescriptorFromCanvasHTMLSelector fromCanvasHTMLSelector;
fromCanvasHTMLSelector.chain.sType = WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector;
#endif
# endif
fromCanvasHTMLSelector.chain.next = NULL;
fromCanvasHTMLSelector.selector = "canvas";

Expand Down

0 comments on commit c063c16

Please sign in to comment.