2023-05-04 23:39:31 +00:00
|
|
|
gsk_private_vulkan_include_shaders = [
|
|
|
|
'clip.frag.glsl',
|
|
|
|
'clip.vert.glsl',
|
2023-05-20 00:56:02 +00:00
|
|
|
'common.frag.glsl',
|
2023-05-15 00:24:50 +00:00
|
|
|
'common.vert.glsl',
|
2023-05-04 23:39:31 +00:00
|
|
|
'constants.glsl',
|
2023-05-06 23:06:52 +00:00
|
|
|
'rect.glsl',
|
|
|
|
'rect.frag.glsl',
|
|
|
|
'rect.vert.glsl',
|
2023-05-04 23:39:31 +00:00
|
|
|
'rounded-rect.glsl',
|
2023-05-06 23:49:29 +00:00
|
|
|
'rounded-rect.frag.glsl',
|
2023-05-04 23:39:31 +00:00
|
|
|
]
|
2017-08-15 15:17:05 +00:00
|
|
|
|
|
|
|
gsk_private_vulkan_fragment_shaders = [
|
2023-06-27 04:05:33 +00:00
|
|
|
'blend-mode.frag',
|
2017-09-03 13:54:47 +00:00
|
|
|
'blur.frag',
|
2017-08-15 15:17:05 +00:00
|
|
|
'border.frag',
|
|
|
|
'color.frag',
|
|
|
|
'color-matrix.frag',
|
2023-07-19 04:14:55 +00:00
|
|
|
'convert.frag',
|
2023-06-27 04:28:52 +00:00
|
|
|
'cross-fade.frag',
|
2023-07-03 05:53:22 +00:00
|
|
|
'glyph.frag',
|
2017-08-15 15:17:05 +00:00
|
|
|
'inset-shadow.frag',
|
|
|
|
'linear.frag',
|
2017-09-01 20:58:42 +00:00
|
|
|
'mask.frag',
|
2017-08-15 15:17:05 +00:00
|
|
|
'outset-shadow.frag',
|
2017-09-30 02:24:53 +00:00
|
|
|
'texture.frag',
|
2017-08-15 15:17:05 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
gsk_private_vulkan_vertex_shaders = [
|
2023-06-27 04:05:33 +00:00
|
|
|
'blend-mode.vert',
|
2017-09-03 13:54:47 +00:00
|
|
|
'blur.vert',
|
2017-08-15 15:17:05 +00:00
|
|
|
'border.vert',
|
|
|
|
'color.vert',
|
|
|
|
'color-matrix.vert',
|
2023-07-19 04:14:55 +00:00
|
|
|
'convert.vert',
|
2023-06-27 04:28:52 +00:00
|
|
|
'cross-fade.vert',
|
2023-07-03 05:53:22 +00:00
|
|
|
'glyph.vert',
|
2017-08-15 15:17:05 +00:00
|
|
|
'inset-shadow.vert',
|
|
|
|
'linear.vert',
|
2017-09-01 20:58:42 +00:00
|
|
|
'mask.vert',
|
2017-08-15 15:17:05 +00:00
|
|
|
'outset-shadow.vert',
|
2017-09-30 02:24:53 +00:00
|
|
|
'texture.vert',
|
2017-08-15 15:17:05 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
gsk_private_vulkan_shaders += gsk_private_vulkan_fragment_shaders
|
|
|
|
gsk_private_vulkan_shaders += gsk_private_vulkan_vertex_shaders
|
|
|
|
|
|
|
|
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)
|
2017-09-03 23:58:41 +00:00
|
|
|
clip_spv_shader = '@0@-clip.@1@.spv'.format(basefn, suffix)
|
|
|
|
clip_rounded_spv_shader = '@0@-clip-rounded.@1@.spv'.format(basefn, suffix)
|
2017-08-15 15:17:05 +00:00
|
|
|
|
2023-07-19 12:15:57 +00:00
|
|
|
compiled_shader = custom_target(spv_shader,
|
|
|
|
input: shader,
|
|
|
|
output: spv_shader,
|
|
|
|
depend_files: gsk_private_vulkan_include_shaders,
|
|
|
|
command: [
|
|
|
|
glslc,
|
|
|
|
stage_arg,
|
|
|
|
'-DCLIP_NONE',
|
|
|
|
'@INPUT@',
|
|
|
|
'-o', '@OUTPUT@'
|
|
|
|
])
|
|
|
|
compiled_clip_shader = custom_target(clip_spv_shader,
|
|
|
|
input: shader,
|
|
|
|
output: clip_spv_shader,
|
|
|
|
depend_files: gsk_private_vulkan_include_shaders,
|
|
|
|
command: [
|
|
|
|
glslc,
|
|
|
|
stage_arg,
|
|
|
|
'-DCLIP_RECT',
|
|
|
|
'@INPUT@',
|
|
|
|
'-o', '@OUTPUT@'
|
|
|
|
])
|
|
|
|
compiled_clip_rounded_shader = custom_target(clip_rounded_spv_shader,
|
|
|
|
input: shader,
|
|
|
|
output: clip_rounded_spv_shader,
|
|
|
|
depend_files: gsk_private_vulkan_include_shaders,
|
|
|
|
command: [
|
|
|
|
glslc,
|
|
|
|
stage_arg,
|
|
|
|
'-DCLIP_ROUNDED_RECT',
|
|
|
|
'@INPUT@',
|
|
|
|
'-o', '@OUTPUT@'
|
|
|
|
])
|
|
|
|
gsk_private_vulkan_compiled_shaders_deps += [compiled_shader, compiled_clip_shader, compiled_clip_rounded_shader]
|
|
|
|
gsk_private_vulkan_compiled_shaders += [spv_shader, clip_spv_shader, clip_rounded_spv_shader]
|
2017-08-15 15:17:05 +00:00
|
|
|
endforeach
|
2023-06-27 04:45:31 +00:00
|
|
|
|
|
|
|
foreach shader: gsk_private_vulkan_vertex_shaders
|
2023-08-21 03:14:33 +00:00
|
|
|
shader_header = custom_target(output: '@0@.h'.format(shader),
|
|
|
|
input: shader,
|
|
|
|
command: [
|
|
|
|
find_program('generate-header.py'),
|
|
|
|
'@INPUT@',
|
|
|
|
],
|
|
|
|
capture: true)
|
2023-06-27 04:45:31 +00:00
|
|
|
gsk_private_vulkan_shader_headers += shader_header
|
|
|
|
endforeach
|