@@ -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 )
0 commit comments