mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 06:52:41 +00:00
vulkan/shaders: change glslc compilation args based on configurations
Add depfile support so that modifying an #included glsl snippet rebuilds all the dependant shaders.
This commit is contained in:
parent
5363b30f6c
commit
2e34dd891d
1 changed files with 21 additions and 2 deletions
|
@ -8,6 +8,23 @@ gst_vulkan_shader_sources = [
|
||||||
|
|
||||||
bin2array = find_program('bin2array.py')
|
bin2array = find_program('bin2array.py')
|
||||||
|
|
||||||
|
# FIXME: meson compiler class instead?
|
||||||
|
glslc_build_options = []
|
||||||
|
optimization = get_option('optimization')
|
||||||
|
buildtype = get_option('buildtype')
|
||||||
|
if get_option('debug') or optimization == 'g' or ['debug', 'debugoptimized'].contains(buildtype)
|
||||||
|
glslc_build_options += ['-g']
|
||||||
|
endif
|
||||||
|
if get_option('werror')
|
||||||
|
glslc_build_options += ['-Werror']
|
||||||
|
endif
|
||||||
|
if buildtype == 'minsize' or optimization == 's'
|
||||||
|
glslc_build_options += ['-Os']
|
||||||
|
endif
|
||||||
|
if ['release', 'debugoptimized'].contains(buildtype) or ['1', '2', '3'].contains(optimization)
|
||||||
|
glslc_build_options += ['-O']
|
||||||
|
endif
|
||||||
|
|
||||||
vulkan_compiled_shader_sources = []
|
vulkan_compiled_shader_sources = []
|
||||||
foreach shader: gst_vulkan_shader_sources
|
foreach shader: gst_vulkan_shader_sources
|
||||||
basefn = shader.split('.').get(0)
|
basefn = shader.split('.').get(0)
|
||||||
|
@ -22,9 +39,11 @@ foreach shader: gst_vulkan_shader_sources
|
||||||
compiled_shader = custom_target(spv_shader,
|
compiled_shader = custom_target(spv_shader,
|
||||||
input: shader,
|
input: shader,
|
||||||
output: spv_shader,
|
output: spv_shader,
|
||||||
command: [
|
depfile: '@PLAINNAME@.d',
|
||||||
glslc,
|
command: [glslc] + glslc_build_options + [
|
||||||
stage_arg,
|
stage_arg,
|
||||||
|
'--target-env=vulkan1.0',
|
||||||
|
'-MD', '-MF', '@DEPFILE@',
|
||||||
'@INPUT@',
|
'@INPUT@',
|
||||||
'-o', '@OUTPUT@'
|
'-o', '@OUTPUT@'
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in a new issue