working on WebGPU support

This commit is contained in:
2025-02-23 17:12:27 +01:00
parent 3a598ab887
commit 443eb6b810
34 changed files with 859 additions and 74 deletions

View File

@@ -5,7 +5,7 @@
local backends = {
Vulkan = {
option = "vulkan",
default = true,
default = not is_plat("wasm"),
packages = { "vulkan-headers", "vulkan-memory-allocator" },
custom = function()
add_defines("VK_NO_PROTOTYPES")
@@ -18,6 +18,16 @@ local backends = {
custom = function()
add_files("Sources/Backends/Metal/**.m")
end
},
WebGPU = {
option = "webgpu",
packages = { "wgpu-native" },
default = is_plat("wasm"),
custom = function()
if is_plat("wasm") then
add_defines("PULSE_PLAT_WASM")
end
end
}
}
@@ -58,6 +68,10 @@ includes("Xmake/**.lua")
option("unitybuild", { description = "Build the library using unity build", default = false })
if is_plat("wasm") then
backends.Vulkan = nil
end
for name, module in pairs(backends) do
if has_config(module.option) then
if module.packages then