Updated HLSL compile script

Recompile mesh shader with EXT instead of NV SPIR-V extension
Fixes #1078
This commit is contained in:
Sascha Willems 2023-10-13 17:02:04 +02:00
parent f685be3445
commit f0d94313b8
2 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,5 @@
# Copyright 2020 Google LLC # Copyright 2020 Google LLC
# Copyright 2023 Sascha Willems
import argparse import argparse
import fileinput import fileinput
@ -33,7 +34,7 @@ dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path = dir_path.replace('\\', '/') dir_path = dir_path.replace('\\', '/')
for root, dirs, files in os.walk(dir_path): for root, dirs, files in os.walk(dir_path):
for file in files: 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"): 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") :
hlsl_file = os.path.join(root, file) hlsl_file = os.path.join(root, file)
spv_out = hlsl_file + ".spv" spv_out = hlsl_file + ".spv"
@ -56,6 +57,9 @@ for root, dirs, files in os.walk(dir_path):
hlsl_file.find('.rmiss') != -1): hlsl_file.find('.rmiss') != -1):
target='-fspv-target-env=vulkan1.2' target='-fspv-target-env=vulkan1.2'
profile = 'lib_6_3' profile = 'lib_6_3'
elif(hlsl_file.find('.mesh') != -1):
target='-fspv-target-env=vulkan1.2'
profile = 'ms_6_6'
print('Compiling %s' % (hlsl_file)) print('Compiling %s' % (hlsl_file))
subprocess.check_output([ subprocess.check_output([