]> git.sesse.net Git - movit/commit
Rework uniform setting.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 13 Sep 2015 15:44:58 +0000 (17:44 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 13 Sep 2015 15:52:47 +0000 (17:52 +0200)
commit9c12e38b7cd88a77ef297d080b7c41e6bd6326fb
tree70c2f968885130bdf5c54a3d54c18896ae5fd7fe
parent1ec439c7fb975c09029adaa9090e7f35ce6484b8
Rework uniform setting.

One would think something as mundane as setting a few uniforms wouldn't
really mean much for performance, but seemingly this is not always so --
I had a real-world shader that counted no less than 55 uniforms.
Of course, not all of these were actually used, but we still have to go
through looking up the name etc. for every single one, every single frame.

Thus, we introduce a new way of dealing with uniforms: Register them before
finalization time, and then EffectChain can store their numbers once and
for all, instead of this repeated lookup. The system is also set up such
that we can go to uniform buffer objects (UBOs) in the very near future.

It's a bit unfortunate that uniform declaration now is removed from the
.frag files, where it sat very nicely, but the alternative would be to
try to parse GLSL, which I'm a bit wary at right now. All effects are
converted, leaving the set_uniform_* functions without any users, but
they are kept around for now in case external effects want them.

This seems to bring 1–2% speedup for my use case; hopefully UBOs will
bring a tiny bit more.
59 files changed:
blur_effect.cpp
blur_effect.frag
blur_effect.h
complex_modulate_effect.cpp
complex_modulate_effect.frag
complex_modulate_effect.h
deconvolution_sharpen_effect.cpp
deconvolution_sharpen_effect.frag
deconvolution_sharpen_effect.h
dither_effect.cpp
dither_effect.frag
dither_effect.h
effect.cpp
effect.h
effect_chain.cpp
effect_chain.h
effect_util.h
fft_input.cpp
fft_input.h
fft_pass_effect.cpp
fft_pass_effect.frag
fft_pass_effect.h
flat_input.cpp
flat_input.frag
flat_input.h
gamma_compression_effect.cpp
gamma_compression_effect.frag
gamma_compression_effect.h
gamma_expansion_effect.cpp
gamma_expansion_effect.frag
gamma_expansion_effect.h
lift_gamma_gain_effect.cpp
lift_gamma_gain_effect.frag
lift_gamma_gain_effect.h
luma_mix_effect.cpp
luma_mix_effect.frag
luma_mix_effect.h
padding_effect.cpp
padding_effect.frag
padding_effect.h
resample_effect.cpp
resample_effect.frag
resample_effect.h
slice_effect.cpp
slice_effect.frag
slice_effect.h
version.h
vignette_effect.cpp
vignette_effect.frag
vignette_effect.h
white_balance_effect.cpp
white_balance_effect.frag
white_balance_effect.h
ycbcr_422interleaved_input.cpp
ycbcr_422interleaved_input.frag
ycbcr_422interleaved_input.h
ycbcr_input.cpp
ycbcr_input.frag
ycbcr_input.h