Update and document shader compilation scripts

Will no longer fail with certain shaderStages
Refs #1126
This commit is contained in:
Sascha Willems 2024-06-04 21:31:24 +02:00
parent 9c25dad12c
commit 196e6a4c6b
3 changed files with 20 additions and 4 deletions

View file

@ -1,5 +1,5 @@
# Copyright 2020 Google LLC
# Copyright 2023 Sascha Willems
# Copyright 2023-2024 Sascha Willems
import argparse
import fileinput
@ -40,6 +40,7 @@ for root, dirs, files in os.walk(dir_path):
target = ''
profile = ''
additional_exts = ''
if(hlsl_file.find('.vert') != -1):
profile = 'vs_6_1'
elif(hlsl_file.find('.frag') != -1):
@ -59,8 +60,12 @@ for root, dirs, files in os.walk(dir_path):
profile = 'lib_6_3'
elif(hlsl_file.find('.mesh') != -1):
target='-fspv-target-env=vulkan1.2'
additional_exts = '-fspv-extension=SPV_EXT_mesh_shader'
profile = 'ms_6_6'
if root.endswith("debugprintf"):
additional_exts = '-fspv-extension=SPV_KHR_non_semantic_info'
print('Compiling %s' % (hlsl_file))
subprocess.check_output([
dxc_path,
@ -73,6 +78,7 @@ for root, dirs, files in os.walk(dir_path):
'-fspv-extension=SPV_EXT_descriptor_indexing',
'-fspv-extension=SPV_KHR_ray_query',
'-fspv-extension=SPV_KHR_fragment_shading_rate',
additional_exts,
target,
hlsl_file,
'-Fo', spv_out])