gtk2/gsk/resources/vulkan/meson.build
Emmanuele Bassi 4904491b77 build: Move Vulkan shader handling to its own directory
Spooky action at a distance is not really allowed in Meson, so the rules
to generate the SPV files should go in their own directory.

Tested by: Rico Tzschichholz <ricotz@ubuntu.com>
2017-08-15 17:07:21 +01:00

57 lines
1.7 KiB
Meson

# FIXME: what's up with these?
#gsk_private_vulkan_include_shaders = [
# 'clip.frag.glsl',
# 'clip.vert.glsl',
# 'constants.glsl',
# 'rounded-rect.glsl',
#]
gsk_private_vulkan_fragment_shaders = [
'blend.frag',
'border.frag',
'color.frag',
'color-matrix.frag',
'inset-shadow.frag',
'linear.frag',
'outset-shadow.frag',
]
gsk_private_vulkan_vertex_shaders = [
'blend.vert',
'border.vert',
'color.vert',
'color-matrix.vert',
'inset-shadow.vert',
'linear.vert',
'outset-shadow.vert',
]
gsk_private_vulkan_shaders += gsk_private_vulkan_fragment_shaders
gsk_private_vulkan_shaders += gsk_private_vulkan_vertex_shaders
glslc = find_program('glslc', required: false)
foreach shader: gsk_private_vulkan_shaders
basefn = shader.split('.').get(0)
suffix = shader.split('.').get(1)
stage_arg = suffix == 'frag' ? '-fshader-stage=fragment' : '-fshader-stage=vertex'
spv_shader = '@0@.@1@.spv'.format(basefn, suffix)
if glslc.found()
compiled_shader = custom_target(spv_shader,
input: shader,
output: spv_shader,
build_by_default: true,
command: [
glslc,
stage_arg,
'-DCLIP_NONE',
'@INPUT@',
'-o', '@OUTPUT@'
])
endif
gsk_private_vulkan_compiled_shaders += files(spv_shader)
gsk_private_vulkan_compiled_shaders += '@0@-clip.@1@.spv'.format(basefn, suffix)
gsk_private_vulkan_compiled_shaders += '@0@-clip-rounded.@1@.spv'.format(basefn, suffix)
endforeach