Enable shader optimization

This commit is contained in:
SirLynix 2022-06-28 08:57:33 +02:00
parent cefa620b20
commit 622b89b0f5
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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 ""