diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 9b5d1bc5..e5dc0af3 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -2020,12 +2020,14 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance, } // autoreleasepool } -typedef struct WGPUSurfaceSourceMetalLayer { +typedef struct WGPUSurfaceSourceMetalLayer +{ WGPUChainedStruct chain; void * layer; } WGPUSurfaceSourceMetalLayer; -WGPUSurface _glfwCreateWindowWGPUSurfaceCocoa(WGPUInstance instance, _GLFWwindow* window) { +WGPUSurface _glfwCreateWindowWGPUSurfaceCocoa(WGPUInstance instance, _GLFWwindow* window) +{ [window->ns.view setLayer:window->ns.layer]; [window->ns.view setWantsLayer:YES]; diff --git a/src/internal.h b/src/internal.h index 1ee044c9..5e409f5a 100644 --- a/src/internal.h +++ b/src/internal.h @@ -335,12 +335,14 @@ typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const c typedef struct WGPUInstanceImpl* WGPUInstance; typedef struct WGPUSurfaceImpl* WGPUSurface; -typedef struct WGPUStringView { +typedef struct WGPUStringView +{ char const * data; size_t length; } WGPUStringView; -typedef enum WGPUSType { +typedef enum WGPUSType +{ WGPUSType_ShaderSourceSPIRV = 0x00000001, WGPUSType_ShaderSourceWGSL = 0x00000002, WGPUSType_RenderPassMaxDrawCount = 0x00000003, @@ -353,12 +355,14 @@ typedef enum WGPUSType { WGPUSType_Force32 = 0x7FFFFFFF } WGPUSType; -typedef struct WGPUChainedStruct { +typedef struct WGPUChainedStruct +{ struct WGPUChainedStruct const * next; WGPUSType sType; } WGPUChainedStruct; -typedef struct WGPUSurfaceDescriptor { +typedef struct WGPUSurfaceDescriptor +{ WGPUChainedStruct const * nextInChain; WGPUStringView label; } WGPUSurfaceDescriptor; diff --git a/src/webgpu.c b/src/webgpu.c index 7a32cfe3..e4155220 100644 --- a/src/webgpu.c +++ b/src/webgpu.c @@ -29,12 +29,14 @@ #include #include -GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*)) { +GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*)) +{ _GLFW_REQUIRE_INIT() _glfw.wgpu.instanceCreateSurface = addr; } -GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle) { +GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle) +{ _GLFW_REQUIRE_INIT_OR_RETURN(NULL) _GLFWwindow* window = (_GLFWwindow*)handle; diff --git a/src/win32_window.c b/src/win32_window.c index e1a8411a..1a1f6ecd 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -2562,13 +2562,15 @@ VkResult _glfwCreateWindowSurfaceWin32(VkInstance instance, return err; } -typedef struct WGPUSurfaceSourceWindowsHWND { +typedef struct WGPUSurfaceSourceWindowsHWND +{ WGPUChainedStruct chain; void * hinstance; void * hwnd; } WGPUSurfaceSourceWindowsHWND; -WGPUSurface _glfwCreateWindowWGPUSurfaceWin32(WGPUInstance instance, _GLFWwindow *window) { +WGPUSurface _glfwCreateWindowWGPUSurfaceWin32(WGPUInstance instance, _GLFWwindow *window) +{ WGPUSurfaceSourceWindowsHWND windowsSurface; windowsSurface.chain.sType = WGPUSType_SurfaceSourceWindowsHWND; windowsSurface.chain.next = NULL; diff --git a/src/wl_window.c b/src/wl_window.c index f19d5a73..4a25b48a 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -3326,13 +3326,15 @@ VkResult _glfwCreateWindowSurfaceWayland(VkInstance instance, return err; } -typedef struct WGPUSurfaceSourceWaylandSurface { +typedef struct WGPUSurfaceSourceWaylandSurface +{ WGPUChainedStruct chain; void * display; void * surface; } WGPUSurfaceSourceWaylandSurface; -WGPUSurface _glfwCreateWindowWGPUSurfaceWayland(WGPUInstance instance, _GLFWwindow* window) { +WGPUSurface _glfwCreateWindowWGPUSurfaceWayland(WGPUInstance instance, _GLFWwindow* window) +{ WGPUSurfaceSourceWaylandSurface waylandSurface; waylandSurface.chain.sType = WGPUSType_SurfaceSourceWaylandSurface; waylandSurface.chain.next = NULL; diff --git a/src/x11_window.c b/src/x11_window.c index 5a60f7a0..72a1a6b0 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -3282,13 +3282,15 @@ VkResult _glfwCreateWindowSurfaceX11(VkInstance instance, } } -typedef struct WGPUSurfaceSourceXCBWindow { +typedef struct WGPUSurfaceSourceXCBWindow +{ WGPUChainedStruct chain; void * connection; uint32_t window; } WGPUSurfaceSourceXCBWindow; -typedef struct WGPUSurfaceSourceXlibWindow { +typedef struct WGPUSurfaceSourceXlibWindow +{ WGPUChainedStruct chain; void * display; uint64_t window;