gtk/gsk/vulkan/resources/meson.build
Benjamin Otte 0f1b039306 vulkan: Implement bindless texture rendering
Instead of having a descriptor set per operation, we just have one
descriptor set and bind all our images into it.

Then the shaders get to use an index into the large texture array
instead.

Getting this to work - because it's a Vulkan extension that needs to be
manually enabled, even though it's officially part of Vulkan 1.2 - is
insane.
2023-06-04 19:42:01 +02:00

93 lines
3.5 KiB
Meson

gsk_private_vulkan_include_shaders = [
'clip.frag.glsl',
'clip.vert.glsl',
'common.frag.glsl',
'common.vert.glsl',
'constants.glsl',
'rect.glsl',
'rect.frag.glsl',
'rect.vert.glsl',
'rounded-rect.glsl',
'rounded-rect.frag.glsl',
]
gsk_private_vulkan_fragment_shaders = [
'blendmode.frag',
'blur.frag',
'border.frag',
'color.frag',
'color-matrix.frag',
'crossfade.frag',
'inset-shadow.frag',
'linear.frag',
'mask.frag',
'outset-shadow.frag',
'texture.frag',
]
gsk_private_vulkan_vertex_shaders = [
'blendmode.vert',
'blur.vert',
'border.vert',
'color.vert',
'color-matrix.vert',
'crossfade.vert',
'inset-shadow.vert',
'linear.vert',
'mask.vert',
'outset-shadow.vert',
'texture.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)
clip_spv_shader = '@0@-clip.@1@.spv'.format(basefn, suffix)
clip_rounded_spv_shader = '@0@-clip-rounded.@1@.spv'.format(basefn, suffix)
if glslc.found()
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]
endif
gsk_private_vulkan_compiled_shaders += files(spv_shader, clip_spv_shader, clip_rounded_spv_shader)
endforeach