Added mesh and task shader support to shader compilation scripts

Simplified file extension checks
Fixes #1143
This commit is contained in:
Sascha Willems 2024-06-23 20:09:05 +02:00
parent d868ac8277
commit 4d2117d3d9
2 changed files with 13 additions and 2 deletions

View file

@ -29,12 +29,14 @@ def findDXC():
sys.exit("Could not find DXC executable on PATH, and was not specified with --dxc")
file_extensions = tuple([".vert", ".frag", ".comp", ".geom", ".tesc", ".tese", ".rgen", ".rchit", ".rmiss", ".mesh", ".task"])
dxc_path = findDXC()
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path = dir_path.replace('\\', '/')
for root, dirs, files in os.walk(dir_path):
for file in files:
if file.endswith(".vert") or file.endswith(".frag") or file.endswith(".comp") or file.endswith(".geom") or file.endswith(".tesc") or file.endswith(".tese") or file.endswith(".rgen") or file.endswith(".rchit") or file.endswith(".rmiss") or file.endswith(".mesh") :
if file.endswith(file_extensions):
hlsl_file = os.path.join(root, file)
spv_out = hlsl_file + ".spv"
@ -62,6 +64,10 @@ for root, dirs, files in os.walk(dir_path):
target='-fspv-target-env=vulkan1.2'
additional_exts = '-fspv-extension=SPV_EXT_mesh_shader'
profile = 'ms_6_6'
elif(hlsl_file.find('.task') != -1):
target='-fspv-target-env=vulkan1.2'
additional_exts = '-fspv-extension=SPV_EXT_mesh_shader'
profile = 'as_6_6'
if root.endswith("debugprintf"):
additional_exts = '-fspv-extension=SPV_KHR_non_semantic_info'