From b8c291df828474c9991d3814e110a4655ac95f6c Mon Sep 17 00:00:00 2001 From: Shan Zhou Date: Sat, 12 Mar 2022 22:32:18 -0800 Subject: Support mesh / raytracing shaders --- xmake/rules/utils/glsl2spv/xmake.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xmake/rules/utils/glsl2spv/xmake.lua b/xmake/rules/utils/glsl2spv/xmake.lua index faf655ec6..94f7b64b4 100644 --- a/xmake/rules/utils/glsl2spv/xmake.lua +++ b/xmake/rules/utils/glsl2spv/xmake.lua @@ -34,7 +34,7 @@ -- -- rule("utils.glsl2spv") - set_extensions(".vert", ".frag", ".tesc", ".tese", ".geom", ".comp", ".glsl") + set_extensions(".vert", ".tesc", ".tese", ".geom", ".comp", ".frag", ".comp", ".mesh", ".task", ".rgen", ".rint", ".rahit", ".rchit", ".rmiss", ".rcall", ".glsl") on_load(function (target) local is_bin2c = target:extraconf("rules", "utils.glsl2spv", "bin2c") if is_bin2c then @@ -57,14 +57,15 @@ rule("utils.glsl2spv") assert(glslangValidator or glslc, "glslangValidator or glslc not found!") -- glsl to spv + local targetenv = target:extraconf("rules", "utils.glsl2spv", "env") or "vulkan1.0" 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, {"-V", "-o", spvfilepath, sourcefile_glsl}) + batchcmds:vrunv(glslangValidator.program, {"--target-env", targetenv, "-o", spvfilepath, sourcefile_glsl}) else - batchcmds:vrunv(glslc.program, {"-o", spvfilepath, sourcefile_glsl}) + batchcmds:vrunv(glslc.program, {"--target-env", targetenv, "-o", spvfilepath, sourcefile_glsl}) end -- do bin2c -- cgit v1.3.1 From a63fb414d214fb08914a6f51dd8af8efefb9a483 Mon Sep 17 00:00:00 2001 From: Shan Zhou Date: Sat, 12 Mar 2022 23:58:29 -0800 Subject: env -> targetenv --- xmake/rules/utils/glsl2spv/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/rules/utils/glsl2spv/xmake.lua b/xmake/rules/utils/glsl2spv/xmake.lua index 94f7b64b4..b7c772a2b 100644 --- a/xmake/rules/utils/glsl2spv/xmake.lua +++ b/xmake/rules/utils/glsl2spv/xmake.lua @@ -57,7 +57,7 @@ rule("utils.glsl2spv") assert(glslangValidator or glslc, "glslangValidator or glslc not found!") -- glsl to spv - local targetenv = target:extraconf("rules", "utils.glsl2spv", "env") or "vulkan1.0" + local targetenv = target:extraconf("rules", "utils.glsl2spv", "targetenv") or "vulkan1.0" 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) -- cgit v1.3.1