Enable shader optimization
This commit is contained in:
parent
cefa620b20
commit
622b89b0f5
|
|
@ -30,13 +30,14 @@ task("compile-shaders")
|
||||||
print("Compiling shaders...")
|
print("Compiling shaders...")
|
||||||
for _, filepath in pairs(os.files("src/Nazara/*/Resources/**.nzsl")) do
|
for _, filepath in pairs(os.files("src/Nazara/*/Resources/**.nzsl")) do
|
||||||
print(" - Compiling " .. filepath)
|
print(" - Compiling " .. filepath)
|
||||||
local argv = {"--compile=nzslb-header", "--partial", filepath }
|
local argv = {"--compile=nzslb-header", "--partial", "--optimize" }
|
||||||
if option.get("measure") then
|
if option.get("measure") then
|
||||||
table.insert(argv, "--measure")
|
table.insert(argv, "--measure")
|
||||||
end
|
end
|
||||||
if option.get("benchmark-iteration") then
|
if option.get("benchmark-iteration") then
|
||||||
table.insert(argv, "--benchmark-iteration=" .. option.get("benchmark-iteration"))
|
table.insert(argv, "--benchmark-iteration=" .. option.get("benchmark-iteration"))
|
||||||
end
|
end
|
||||||
|
table.insert(argv, filepath)
|
||||||
os.vrunv(nzsl, argv, { envs = envs })
|
os.vrunv(nzsl, argv, { envs = envs })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ rule("nzsl.compile.shaders")
|
||||||
|
|
||||||
-- add commands
|
-- add commands
|
||||||
batchcmds:show_progress(opt.progress, "${color.build.object}compiling shader %s", shaderfile)
|
batchcmds:show_progress(opt.progress, "${color.build.object}compiling shader %s", shaderfile)
|
||||||
local argv = {"--compile=nzslb-header", "--partial"}
|
local argv = { "--compile=nzslb-header", "--partial", "--optimize" }
|
||||||
|
|
||||||
-- handle --log-format
|
-- handle --log-format
|
||||||
local kind = target:data("plugin.project.kind") or ""
|
local kind = target:data("plugin.project.kind") or ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue