Add Webgpu backend (#2132)

* WebGPU first draft (shaderc bin version 8)

* WebGPU scripts
This commit is contained in:
Hugo Amnov
2020-05-08 17:53:53 +02:00
committed by GitHub
parent ee96333452
commit b62302631e
36 changed files with 14929 additions and 24 deletions

View File

@@ -3,6 +3,11 @@
-- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
--
newoption {
trigger = "webgpu",
description = "Enable webgpu experimental renderer.",
}
newoption {
trigger = "with-amalgamated",
description = "Enable amalgamated build.",
@@ -162,6 +167,12 @@ if not os.isdir(BX_DIR) or not os.isdir(BIMG_DIR) then
os.exit()
end
if _OPTIONS["webgpu"] then
DAWN_DIR = os.getenv("DAWN_DIR")
_OPTIONS["with-windows"] = "10.0"
end
dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
if not toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR) then
return -- no action specified
@@ -214,6 +225,10 @@ function exampleProjectDefaults()
"bx",
}
if _OPTIONS["webgpu"] then
usesWebGPU()
end
if _OPTIONS["with-sdl"] then
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }