mirror of
https://github.com/glfw/glfw.git
synced 2025-12-21 14:42:06 +00:00
Compare commits
No commits in common. "1471e07cebf3fd36f4d8271454b9c2b3e384442f" and "b0b39d678e2224689d6cba86249dd14d178e5562" have entirely different histories.
1471e07ceb
...
b0b39d678e
@ -73,16 +73,8 @@ int main(void)
|
|||||||
exit(EXIT_FAILURE);
|
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;
|
WGPUAdapter adapter;
|
||||||
|
WGPUSurface surface = glfwCreateWindowWGPUSurface(instance, window);
|
||||||
WGPUDevice device;
|
WGPUDevice device;
|
||||||
WGPUQueue queue;
|
WGPUQueue queue;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|||||||
@ -6536,19 +6536,6 @@ GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window
|
|||||||
|
|
||||||
#if defined(WEBGPU_H_)
|
#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.
|
/*! @brief Creates a WebGPU surface for the specified window.
|
||||||
*
|
*
|
||||||
* This function creates a WebGPU surface for the specified window.
|
* This function creates a WebGPU surface for the specified window.
|
||||||
|
|||||||
@ -367,8 +367,7 @@ typedef struct WGPUSurfaceDescriptor
|
|||||||
WGPUStringView label;
|
WGPUStringView label;
|
||||||
} WGPUSurfaceDescriptor;
|
} WGPUSurfaceDescriptor;
|
||||||
|
|
||||||
typedef WGPUSurface (*PFN_wgpuInstanceCreateSurface)(WGPUInstance, const WGPUSurfaceDescriptor*);
|
extern WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, const WGPUSurfaceDescriptor* descriptor) __attribute((weak));
|
||||||
#define wgpuInstanceCreateSurface _glfw.wgpu.instanceCreateSurface
|
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
@ -915,10 +914,6 @@ struct _GLFWlibrary
|
|||||||
GLFWbool EXT_headless_surface;
|
GLFWbool EXT_headless_surface;
|
||||||
} vk;
|
} vk;
|
||||||
|
|
||||||
struct {
|
|
||||||
PFN_wgpuInstanceCreateSurface instanceCreateSurface;
|
|
||||||
} wgpu;
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLFWmonitorfun monitor;
|
GLFWmonitorfun monitor;
|
||||||
GLFWjoystickfun joystick;
|
GLFWjoystickfun joystick;
|
||||||
|
|||||||
@ -29,12 +29,6 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.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)
|
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
|
||||||
@ -43,7 +37,7 @@ GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindo
|
|||||||
|
|
||||||
assert(window != NULL);
|
assert(window != NULL);
|
||||||
assert(instance != NULL);
|
assert(instance != NULL);
|
||||||
assert(_glfw.wgpu.instanceCreateSurface != NULL);
|
assert(&wgpuInstanceCreateSurface != NULL);
|
||||||
|
|
||||||
if (window->context.client != GLFW_NO_API)
|
if (window->context.client != GLFW_NO_API)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user