From 622b89b0f5842a45aa69f065bc7c4404f0c64ba2 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Tue, 28 Jun 2022 08:57:33 +0200 Subject: [PATCH] Enable shader optimization --- xmake/actions/compile_shaders.lua | 3 ++- xmake/rules/compile_shaders.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xmake/actions/compile_shaders.lua b/xmake/actions/compile_shaders.lua index ec04858c7..bd77aa6aa 100644 --- a/xmake/actions/compile_shaders.lua +++ b/xmake/actions/compile_shaders.lua @@ -30,13 +30,14 @@ task("compile-shaders") print("Compiling shaders...") for _, filepath in pairs(os.files("src/Nazara/*/Resources/**.nzsl")) do print(" - Compiling " .. filepath) - local argv = {"--compile=nzslb-header", "--partial", filepath } + local argv = {"--compile=nzslb-header", "--partial", "--optimize" } if option.get("measure") then table.insert(argv, "--measure") end if option.get("benchmark-iteration") then table.insert(argv, "--benchmark-iteration=" .. option.get("benchmark-iteration")) end + table.insert(argv, filepath) os.vrunv(nzsl, argv, { envs = envs }) end end) diff --git a/xmake/rules/compile_shaders.lua b/xmake/rules/compile_shaders.lua index 3c99d696c..b02407a4c 100644 --- a/xmake/rules/compile_shaders.lua +++ b/xmake/rules/compile_shaders.lua @@ -11,7 +11,7 @@ rule("nzsl.compile.shaders") -- add commands 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 local kind = target:data("plugin.project.kind") or ""