diff options
| author | Shan Zhou <[email protected]> | 2022-03-12 22:32:18 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-12 22:32:18 -0800 |
| commit | b8c291df828474c9991d3814e110a4655ac95f6c (patch) | |
| tree | 5bed1fbe5e17979111c9897e4c3774475e710b96 | |
| parent | d5eb35f0c29ddb3f1944368f74315e686e7a52dd (diff) | |
Support mesh / raytracing shaders
| -rw-r--r-- | xmake/rules/utils/glsl2spv/xmake.lua | 7 |
1 files 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 |
