From 69d5d2adde1d13578a94e8b1934235987cf9b2bd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 6 Jan 2021 23:53:33 +0100 Subject: Switch to Meson --- examples/shaders/meson.build | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/shaders/meson.build (limited to 'examples/shaders') diff --git a/examples/shaders/meson.build b/examples/shaders/meson.build new file mode 100644 index 0000000..e47be9d --- /dev/null +++ b/examples/shaders/meson.build @@ -0,0 +1,35 @@ +shader_files = [ + 'header_330.glsl', + 'header_420.glsl', + 'rect.frag', + 'rect.vert', +] + +# Copy shader sources for GL examples +foreach shader_file : shader_files + configure_file(copy: true, input: shader_file, output: shader_file) +endforeach + +# Build SPV shader binaries for Vulkan examples +if vulkan_dep.found() + cat = find_program('../../scripts/cat.py') + glslang = find_program('glslangValidator') + + shaders = ['rect.vert', 'rect.frag'] + foreach shader : shaders + source = shader.split('.')[0] + '.vulkan.' + shader.split('.')[1] + shader_input = custom_target(source, + output: source, + input: ['header_420.glsl', shader], + command: [cat, '@INPUT@'], + build_by_default: true, + capture: true) + + mytarget = custom_target(shader, + output: shader + '.spv', + input: shader_input, + command: [glslang, '-V', '-o', '@OUTPUT@', '@INPUT@'], + build_by_default: true, + install: false) + endforeach +endif -- cgit v1.2.1