Compare commits

..

No commits in common. "1471e07cebf3fd36f4d8271454b9c2b3e384442f" and "b0b39d678e2224689d6cba86249dd14d178e5562" have entirely different histories.

4 changed files with 3 additions and 35 deletions

View File

@ -73,16 +73,8 @@ int main(void)
exit(EXIT_FAILURE);
}
WGPUSurface surface = glfwCreateWindowWGPUSurface(instance, window);
if (!surface)
{
fprintf(stderr, "Error: Failed to create WebGPU surface.\n");
wgpuInstanceRelease(instance);
glfwDestroyWindow(window);
glfwTerminate();
exit(EXIT_FAILURE);
}
WGPUAdapter adapter;
WGPUSurface surface = glfwCreateWindowWGPUSurface(instance, window);
WGPUDevice device;
WGPUQueue queue;
bool success = false;

View File

@ -6536,19 +6536,6 @@ GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window
#if defined(WEBGPU_H_)
/*! @brief Provide the address of the `wgpuInstanceCreateSurface` function to GLFW.
*
* This function passes the address provided for the `wgpuInstanceCreateSurface` function
* to GLFW.
*
* @param[in] addr The address of the `wgpuInstanceCreateSurface` function.
*
* @since Added in version 3.5
*
* @ingroup webgpu
*/
GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*));
/*! @brief Creates a WebGPU surface for the specified window.
*
* This function creates a WebGPU surface for the specified window.

View File

@ -367,8 +367,7 @@ typedef struct WGPUSurfaceDescriptor
WGPUStringView label;
} WGPUSurfaceDescriptor;
typedef WGPUSurface (*PFN_wgpuInstanceCreateSurface)(WGPUInstance, const WGPUSurfaceDescriptor*);
#define wgpuInstanceCreateSurface _glfw.wgpu.instanceCreateSurface
extern WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, const WGPUSurfaceDescriptor* descriptor) __attribute((weak));
#include "platform.h"
@ -915,10 +914,6 @@ struct _GLFWlibrary
GLFWbool EXT_headless_surface;
} vk;
struct {
PFN_wgpuInstanceCreateSurface instanceCreateSurface;
} wgpu;
struct {
GLFWmonitorfun monitor;
GLFWjoystickfun joystick;

View File

@ -29,12 +29,6 @@
#include <assert.h>
#include <stdlib.h>
GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*))
{
_GLFW_REQUIRE_INIT()
_glfw.wgpu.instanceCreateSurface = addr;
}
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle)
{
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
@ -43,7 +37,7 @@ GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindo
assert(window != NULL);
assert(instance != NULL);
assert(_glfw.wgpu.instanceCreateSurface != NULL);
assert(&wgpuInstanceCreateSurface != NULL);
if (window->context.client != GLFW_NO_API)
{