Skip to content

Commit

Permalink
Merge pull request #641 from evo-lua/update-glfw3wgpu-submodule
Browse files Browse the repository at this point in the history
Reintroduce glfw3wgpu as a git submodule
  • Loading branch information
rdw-software authored Jan 10, 2025
2 parents ed5fb45 + 40d56f8 commit e9b0e3a
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 218 deletions.
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.

0 comments on commit e9b0e3a

Please sign in to comment.