Skip to content

Commit 1a06a8e

Browse files
authored
Update nzsl to v1.1.2 (#8530)
* Update nzsl to v1.1.2 * update nzsl rules
1 parent 81b8b87 commit 1a06a8e

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

packages/n/nzsl/rules/archive_shaders.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ rule("archive.shaders")
33
set_extensions(".nzsla")
44
add_deps("@nzsl/find_nzsl")
55

6-
if add_orders then
7-
add_deps("@nzsl/compile.shaders")
8-
add_orders("@nzsl/compile.shaders", "@nzsl/archive.shaders")
9-
else
10-
add_deps("@nzsl/compile.shaders", { order = true })
11-
end
6+
if add_orders then
7+
add_deps("@nzsl/compile.shaders")
8+
add_orders("@nzsl/compile.shaders", "@nzsl/archive.shaders")
9+
else
10+
add_deps("@nzsl/compile.shaders", { order = true })
11+
end
1212

1313
before_buildcmd_file(function (target, batchcmds, sourcefile, opt)
14+
import("core.base.semver")
15+
1416
local nzsla = target:data("nzsla")
1517
local runenvs = target:data("nzsl_runenv")
1618
assert(nzsla, "nzsla not found! please install nzsl package with nzsla enabled")
@@ -19,6 +21,9 @@ rule("archive.shaders")
1921

2022
batchcmds:show_progress(opt.progress, "${color.build.object}archiving.shaders %s", sourcefile)
2123
local argv = { "--archive" }
24+
if semver.compare(nzsla.version, "1.1.0") >= 0 then
25+
table.insert(argv, "--skip-unchanged")
26+
end
2227

2328
if fileconfig.compress then
2429
if type(fileconfig.compress) == "string" then

packages/n/nzsl/rules/compile_shaders.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rule("compile.shaders")
2626
if not table.empty(archives) then
2727
assert(target:rule("@nzsl/archive.shaders"), "you must add the @nzsl/archive.shaders rule to the target")
2828
for archive, archivefiles in table.orderpairs(archives) do
29-
local args = { rule = "@nzsl/archive.shaders", always_added = true, compress = true, files = archivefiles }
29+
local args = { always_added = true, compress = true, files = archivefiles }
3030
if archive:endswith(".nzsla.h") or archive:endswith(".nzsla.hpp") then
3131
args.header = path.extension(archive)
3232
archive = archive:sub(1, -#args.header - 1) -- foo.nzsla.h => foo.nzsla
@@ -38,6 +38,8 @@ rule("compile.shaders")
3838
end)
3939

4040
before_buildcmd_file(function (target, batchcmds, shaderfile, opt)
41+
import("core.base.semver")
42+
4143
local outputdir = target:data("nzsl_includedirs")
4244
local nzslc = target:data("nzslc")
4345
local runenvs = target:data("nzsl_runenv")
@@ -48,7 +50,10 @@ rule("compile.shaders")
4850

4951
-- add commands
5052
batchcmds:show_progress(opt.progress, "${color.build.object}compiling.shader %s", shaderfile)
51-
local argv = { "--compile=nzslb" .. (header and "-header" or ""), "--partial", "--optimize", "--skip-unchanged" }
53+
local argv = { "--compile=nzslb" .. (header and "-header" or ""), "--partial", "--optimize" }
54+
if semver.compare(nzslc.version, "1.1.0") >= 0 then
55+
table.insert(argv, "--skip-unchanged")
56+
end
5257
if outputdir then
5358
batchcmds:mkdir(outputdir)
5459
table.insert(argv, "--output=" .. outputdir)

packages/n/nzsl/xmake.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ package("nzsl")
66
add_urls("https://github.com/NazaraEngine/ShaderLang/archive/refs/tags/$(version).tar.gz",
77
"https://github.com/NazaraEngine/ShaderLang.git")
88

9+
add_versions("v1.1.2", "48b3e5ce18f0c3d4bf22c0201ab41664b30c1d40f7df31b776d2d37a1559c0fb")
10+
add_versions("v1.1.1", "e4e37d3274936d8f040d4ed29d2aa20b6cc93de755aa070309fd01cc17140525")
911
add_versions("v1.1.0", "8b401a199c6ee7b2cc3b24871bbec2857a70ff47a25f043e35db54fa1f4129ef")
1012
add_versions("v1.0.0", "ef434fec5d32ddf64f2f7c7691a4d96a6ac24cab4cc6c091d46a542c86825359")
1113

0 commit comments

Comments
 (0)