summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-26 11:57:44 +0800
committerGitHub <[email protected]>2024-11-26 11:57:44 +0800
commit298df259a88bc8f77849721860634f90a2309666 (patch)
tree9724cf59d9f66e466a6028893a6aa76509ebc293
parent31e50658618dee993aae0a7928884b26f6372d17 (diff)
parent2fe33df70ba6511b7ae847d34ca5d62c03db3c1e (diff)
Merge pull request #5879 from dddddjent/dev
add debugsource param to rule utils.glsl2spv
-rw-r--r--xmake/rules/utils/glsl2spv/xmake.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/rules/utils/glsl2spv/xmake.lua b/xmake/rules/utils/glsl2spv/xmake.lua
index 5325b3d25..f0adac185 100644
--- a/xmake/rules/utils/glsl2spv/xmake.lua
+++ b/xmake/rules/utils/glsl2spv/xmake.lua
@@ -59,12 +59,17 @@ rule("utils.glsl2spv")
-- glsl to spv
local targetenv = target:extraconf("rules", "utils.glsl2spv", "targetenv") or "vulkan1.0"
local client = target:extraconf("rules", "utils.glsl2spv", "client") or "vulkan100"
+ local debugsource = target:extraconf("rules", "utils.glsl2spv", "debugsource") or false
local outputdir = target:extraconf("rules", "utils.glsl2spv", "outputdir") or path.join(target:autogendir(), "rules", "utils", "glsl2spv")
local spvfilepath = path.join(outputdir, path.filename(sourcefile_glsl) .. ".spv")
batchcmds:show_progress(opt.progress, "${color.build.object}generating.glsl2spv %s", sourcefile_glsl)
batchcmds:mkdir(outputdir)
if glslangValidator then
- batchcmds:vrunv(glslangValidator.program, {"--target-env", targetenv, "--client", client, "-o", path(spvfilepath), path(sourcefile_glsl)})
+ if debugsource then
+ batchcmds:vrunv(glslangValidator.program, {"--target-env", targetenv, "--client", client, "-gVS", "-o", path(spvfilepath), path(sourcefile_glsl)})
+ else
+ batchcmds:vrunv(glslangValidator.program, {"--target-env", targetenv, "--client", client, "-o", path(spvfilepath), path(sourcefile_glsl)})
+ end
else
batchcmds:vrunv(glslc.program, {"--target-env", targetenv, "-o", path(spvfilepath), path(sourcefile_glsl)})
end