summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-07 23:31:06 +0800
committerruki <[email protected]>2025-12-07 23:31:06 +0800
commitc4f48bbfda999f7b6dfb575059f4c5b676643294 (patch)
treea0fe773e7cbb4102747231ca958952867263c8f2
parentd51cb68331dae5c27f7af8515ec83e9764a832a7 (diff)
fix zeroend
-rw-r--r--tests/projects/other/hlsl2spv_bin2obj/xmake.lua2
-rw-r--r--xmake/rules/utils/glsl2spv/xmake.lua6
-rw-r--r--xmake/rules/utils/hlsl2spv/xmake.lua6
3 files changed, 9 insertions, 5 deletions
diff --git a/tests/projects/other/hlsl2spv_bin2obj/xmake.lua b/tests/projects/other/hlsl2spv_bin2obj/xmake.lua
index 2184d24cc..4d09e5036 100644
--- a/tests/projects/other/hlsl2spv_bin2obj/xmake.lua
+++ b/tests/projects/other/hlsl2spv_bin2obj/xmake.lua
@@ -6,6 +6,6 @@ target("test")
set_kind("binary")
add_rules("utils.hlsl2spv", {bin2obj = true})
add_files("src/*.c")
- add_files("src/*.hlsl", "src/*.hlsl")
+ add_files("src/*.hlsl")
add_packages("directxshadercompiler")
diff --git a/xmake/rules/utils/glsl2spv/xmake.lua b/xmake/rules/utils/glsl2spv/xmake.lua
index a534b43ad..01abc561a 100644
--- a/xmake/rules/utils/glsl2spv/xmake.lua
+++ b/xmake/rules/utils/glsl2spv/xmake.lua
@@ -90,17 +90,19 @@ rule("utils.glsl2spv")
local is_bin2obj = target:extraconf("rules", "utils.glsl2spv", "bin2obj")
if is_bin2c then
-- generate header file
+ -- note: explicitly disable zeroend (SPIR-V is binary format, not null-terminated string)
local headerfile = bin2c_utils.generate_headerfile(target, batchcmds, spvfilepath, {
progress = opt.progress,
headerdir = outputdir,
- zeroend = true -- default enable zeroend for shader data
+ zeroend = false -- SPIR-V is binary format, not null-terminated string
})
outputfile = headerfile
elseif is_bin2obj then
-- convert to object file using bin2obj
+ -- note: zeroend is false by default (SPIR-V is binary format, not null-terminated string)
local objectfile = bin2obj_utils.generate_objectfile(target, batchcmds, spvfilepath, {
progress = opt.progress,
- zeroend = true -- default enable zeroend for shader data
+ rulename = "utils.glsl2spv" -- pass current rule name for config lookup
})
outputfile = objectfile
end
diff --git a/xmake/rules/utils/hlsl2spv/xmake.lua b/xmake/rules/utils/hlsl2spv/xmake.lua
index a1326b97f..750574eac 100644
--- a/xmake/rules/utils/hlsl2spv/xmake.lua
+++ b/xmake/rules/utils/hlsl2spv/xmake.lua
@@ -89,17 +89,19 @@ rule("utils.hlsl2spv")
local is_bin2obj = target:extraconf("rules", "utils.hlsl2spv", "bin2obj")
if is_bin2c then
-- generate header file
+ -- note: explicitly disable zeroend (SPIR-V is binary format, not null-terminated string)
local headerfile = bin2c_utils.generate_headerfile(target, batchcmds, spvfilepath, {
progress = opt.progress,
headerdir = outputdir,
- zeroend = true -- default enable zeroend for shader data
+ zeroend = false -- SPIR-V is binary format, not null-terminated string
})
outputfile = headerfile
elseif is_bin2obj then
-- convert to object file using bin2obj
+ -- note: zeroend is false by default (SPIR-V is binary format, not null-terminated string)
local objectfile = bin2obj_utils.generate_objectfile(target, batchcmds, spvfilepath, {
progress = opt.progress,
- zeroend = true -- default enable zeroend for shader data
+ rulename = "utils.hlsl2spv" -- pass current rule name for config lookup
})
outputfile = objectfile
end