This commit is contained in:
Бранимир Караџић 2020-05-09 10:24:23 -07:00
parent f13e5adf4b
commit bbd41124b7
2 changed files with 42 additions and 30 deletions

View File

@ -163,11 +163,21 @@ function bgfxProjectBase(_kind, _defines)
path.join(BGFX_DIR, "src/renderer_nvn.h"),
})
if _OPTIONS["webgpu"] then
if _OPTIONS["with-webgpu"] then
defines {
"BGFX_CONFIG_RENDERER_WEBGPU=1",
}
local generator = "out/VS2019"
includedirs {
path.join(DAWN_DIR, "src"),
path.join(DAWN_DIR, "src/include"),
path.join(DAWN_DIR, "third_party/vulkan-headers/include"),
path.join(DAWN_DIR, generator, "gen/src"),
path.join(DAWN_DIR, generator, "gen/src/include"),
}
configuration { "asmjs" }
defines {
"BGFX_CONFIG_RENDERER_OPENGL=0",
@ -176,27 +186,18 @@ function bgfxProjectBase(_kind, _defines)
configuration { "not asmjs" }
--local generator = "out/Default"
local generator = "out/VS2019"
includedirs {
path.join(DAWN_DIR, "src"),
path.join(DAWN_DIR, "src/include"),
path.join(DAWN_DIR, "third_party/vulkan-headers/include"),
path.join(DAWN_DIR, generator, "gen/src"),
path.join(DAWN_DIR, generator, "gen/src/include"),
configuration { "vs*" }
defines {
"NTDDI_VERSION=NTDDI_WIN10_RS2",
-- We can't say `=_WIN32_WINNT_WIN10` here because some files do
-- `#if WINVER < 0x0600` without including windows.h before,
-- and then _WIN32_WINNT_WIN10 isn't yet known to be 0x0A00.
"_WIN32_WINNT=0x0A00",
"WINVER=0x0A00",
}
configuration { "vs*" }
defines {
"NTDDI_VERSION=NTDDI_WIN10_RS2",
-- We can't say `=_WIN32_WINNT_WIN10` here because some files do
-- `#if WINVER < 0x0600` without including windows.h before,
-- and then _WIN32_WINNT_WIN10 isn't yet known to be 0x0A00.
"_WIN32_WINNT=0x0A00",
"WINVER=0x0A00",
}
configuration {}
end
@ -272,7 +273,7 @@ function bgfxProject(_name, _kind, _defines)
copyLib()
end
if _OPTIONS["webgpu"] then
if _OPTIONS["with-webgpu"] then
function usesWebGPU()
configuration { "asmjs" }
linkoptions {

View File

@ -3,11 +3,6 @@
-- 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.",
@ -53,6 +48,11 @@ newoption {
description = "Enable building examples.",
}
newoption {
trigger = "with-webgpu",
description = "Enable webgpu experimental renderer.",
}
newaction {
trigger = "idl",
description = "Generate bgfx interface source code",
@ -156,19 +156,30 @@ end
if not os.isdir(BX_DIR) or not os.isdir(BIMG_DIR) then
if not os.isdir(BX_DIR) then
print("bx not found at " .. BX_DIR)
print("bx not found at \"" .. BX_DIR .. "\". git clone https://github.com/bkaradzic/bx?")
end
if not os.isdir(BIMG_DIR) then
print("bimg not found at " .. BIMG_DIR)
print("bimg not found at \"" .. BIMG_DIR .. "\". git clone https://github.com/bkaradzic/bimg?")
end
print("For more info see: https://bkaradzic.github.io/bgfx/build.html")
os.exit()
end
if _OPTIONS["webgpu"] then
DAWN_DIR = os.getenv("DAWN_DIR")
if _OPTIONS["with-webgpu"] then
DAWN_DIR = os.getenv("DAWN_DIR")
if not DAWN_DIR then
DAWN_DIR = path.getabsolute(path.join(BGFX_DIR, "../dawn"))
end
if not os.isdir(DAWN_DIR) then
print("Dawn not found at \"" .. DAWN_DIR .. "\". git clone https://dawn.googlesource.com/dawn?")
print("For more info see: https://bkaradzic.github.io/bgfx/build.html")
os.exit()
end
_OPTIONS["with-windows"] = "10.0"
end
@ -225,7 +236,7 @@ function exampleProjectDefaults()
"bx",
}
if _OPTIONS["webgpu"] then
if _OPTIONS["with-webgpu"] then
usesWebGPU()
end