gstreamer/subprojects/gst-plugins-bad/gst-libs/gst/d3dshader/plugin-hlsl/meson.build
Seungha Yang 13c90b606a d3dshader: Add HLSL shader library
Adding a new library for HLSL compile and compiled bytecode caching.
This library will be used by d3d11 and d3d12 library/plugin, in order to
reuse single HLSL code and compiled HLSL bytecode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6434>
2024-03-24 22:05:49 +09:00

65 lines
1.9 KiB
Meson

hlsl_sources = [
['PSMain_checker_luma', 'ps'],
['PSMain_checker_rgb', 'ps'],
['PSMain_checker_vuya', 'ps'],
['PSMain_checker', 'ps'],
['PSMain_color', 'ps'],
['PSMain_sample_premul', 'ps'],
['PSMain_sample', 'ps'],
['PSMain_snow', 'ps'],
['VSMain_color', 'vs'],
['VSMain_coord', 'vs'],
['VSMain_pos', 'vs'],
]
shader_model = '5_0'
plugin_hlsl_precompiled = []
foreach shader : hlsl_sources
entry_point_prefix = shader.get(0)
target_prefix = shader.get(1)
source = files('@0@.hlsl'.format(entry_point_prefix))
entry_point = '@0@_@1@'.format(entry_point_prefix, shader_model)
header = '@0@.h'.format(entry_point)
sm_target = '@0@_@1@'.format(target_prefix, shader_model)
compiled_shader = custom_target(header,
input : source,
output : header,
command : [fxc, '/Fh', '@OUTPUT@',
'/E', entry_point,
'/T', sm_target,
'/D', 'BUILDING_HLSL=1',
'/D', 'ENTRY_POINT=@0@'.format(entry_point),
'/nologo',
'@INPUT@'])
plugin_hlsl_precompiled += [compiled_shader]
endforeach
header_collector = find_program('collect_hlsl_headers.py')
plugin_ps_collection = custom_target('plugin_hlsl_ps',
input : plugin_hlsl_precompiled,
output : 'plugin_hlsl_ps.h',
command : [header_collector,
'--input', meson.current_build_dir(),
'--prefix', 'PSMain_',
'--name', 'g_plugin_ps_table',
'--output', '@OUTPUT@'
])
plugin_vs_collection = custom_target('plugin_hlsl_vs',
input : plugin_hlsl_precompiled,
output : 'plugin_hlsl_vs.h',
command : [header_collector,
'--input', meson.current_build_dir(),
'--prefix', 'VSMain_',
'--name', 'g_plugin_vs_table',
'--output', '@OUTPUT@'
])
hlsl_precompiled += [
plugin_hlsl_precompiled,
plugin_ps_collection,
plugin_vs_collection,
]