mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -04:00
Instead of having 3 different fragment shaders for textures and 1 more for quads, unify them all and compile different variants via a SOURCE constant. In the future, we will have more variant dimensions: pre-multiplied alpha on/off, color transformation, etc. It will become inpractical to have one file per combination. Weston has a similar approach: https://gitlab.freedesktop.org/wayland/weston/-/blob/main/libweston/renderer-gl/fragment.glsl
19 lines
339 B
Meson
19 lines
339 B
Meson
embed = find_program('./embed.sh', native: true)
|
|
|
|
shaders = [
|
|
'common.vert',
|
|
'common.frag',
|
|
]
|
|
|
|
foreach name : shaders
|
|
output = name.underscorify() + '_src.h'
|
|
var = name.underscorify() + '_src'
|
|
wlr_files += custom_target(
|
|
output,
|
|
command: [embed, var],
|
|
input: name,
|
|
output: output,
|
|
feed: true,
|
|
capture: true,
|
|
)
|
|
endforeach
|