Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce glfw3wgpu as a git submodule #641

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,9 @@
path = deps/Tencent/rapidjson
url = https://github.com/Tencent/rapidjson
ignore = dirty
branch = master
branch = master
[submodule "glfw3webgpu"]
path = deps/eliemichel/glfw3webgpu
url = https://github.com/eliemichel/glfw3webgpu
ignore = dirty
branch = main
2 changes: 1 addition & 1 deletion Runtime/Bindings/FFI/glfw/glfw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct static_glfw_exports_table {
const char* (*glfw_version)(void);
int (*glfw_find_constant)(const char* name);

WGPUSurface (*glfw_get_wgpu_surface)(WGPUInstance instance, GLFWwindow* window);
WGPUSurface (*glfw_create_window_wgpu_surface)(WGPUInstance instance, GLFWwindow* window);

int (*glfw_init)(void);
void (*glfw_terminate)(void);
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Bindings/FFI/glfw/glfw_exports.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ struct static_glfw_exports_table {
const char* (*glfw_version)(void);
int (*glfw_find_constant)(const char* name);

WGPUSurface (*glfw_get_wgpu_surface)(WGPUInstance instance, GLFWwindow* window);
WGPUSurface (*glfw_create_window_wgpu_surface)(WGPUInstance instance, GLFWwindow* window);

int (*glfw_init)(void);
void (*glfw_terminate)(void);
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Bindings/FFI/glfw/glfw_ffi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ namespace glfw_ffi {
exports.glfw_version = glfw_version;
exports.glfw_find_constant = glfw_find_constant;

exports.glfw_get_wgpu_surface = glfwGetWGPUSurface;
exports.glfw_create_window_wgpu_surface = glfwCreateWindowWGPUSurface;

exports.glfw_init = glfwInit;
exports.glfw_terminate = glfwTerminate;
Expand Down
3 changes: 3 additions & 0 deletions Runtime/Bindings/FFI/wgpu/webgpu/webgpu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Workaround for the hardcoded header path in glfw3wgpu - remove later

#include <webgpu.h>
2 changes: 1 addition & 1 deletion Tests/BDD/glfw-library.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("glfw", function()
local exportedApiSurface = {
"glfw_version",
"glfw_find_constant",
"glfw_get_wgpu_surface",
"glfw_create_window_wgpu_surface",
"glfw_init",
"glfw_terminate",
"glfw_poll_events",
Expand Down
2 changes: 1 addition & 1 deletion Tests/BDD/runtime-library.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("runtime", function()
assertSubmoduleVersion(runtime.submodules["deps/zhaog/lua-openssl"])
assertSubmoduleVersion(runtime.submodules["deps/Tencent/rapidjson"])

assertEquals(table.count(runtime.submodules), 23)
assertEquals(table.count(runtime.submodules), 24)
end)
end)
end)
2 changes: 1 addition & 1 deletion Tests/Integration/glfw-webgpu-surface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local window = glfw.bindings.glfw_create_window(640, 480, "WebGPU Surface Test",
assert(window, "Failed to create window")

print("Requesting adapter...")
local surface = glfw.bindings.glfw_get_wgpu_surface(instance, window)
local surface = glfw.bindings.glfw_create_window_wgpu_surface(instance, window)
assert(surface, "Failed to create WebGPU surface")

local adapterOpts = ffi.new("WGPURequestAdapterOptions")
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/rml-glfw-wgpu-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local function createDevice(window)
error("Could not initialize WebGPU!")
end

local surface = glfw.bindings.glfw_get_wgpu_surface(instance, window)
local surface = glfw.bindings.glfw_create_window_wgpu_surface(instance, window)
assert(surface, "Failed to create WebGPU surface")

local adapterOptions = ffi.new("WGPURequestAdapterOptions")
Expand Down
1 change: 1 addition & 0 deletions deps/eliemichel/glfw3webgpu
Submodule glfw3webgpu added at 9a240a
161 changes: 0 additions & 161 deletions deps/eliemichel/glfw3webgpu/glfw3webgpu.c

This file was deleted.

49 changes: 0 additions & 49 deletions deps/eliemichel/glfw3webgpu/glfw3webgpu.h

This file was deleted.

Loading