0f52da6226
This patch gathers all values to be loaded to shader uniforms into a new struct gl_shader_config along with texture target and filter information. Struct gl_shader becomes opaque outside of gl-shaders.c. Everything that used or open-coded these are converted. The aim is to make gl-renderer.c easier to read. Previously, uniform values were loaded up in various places, texture units were set up in one place, textures were bound into units in different places. Stuff was all over the place. Now, shader requirements and associated uniform data is stored in a single struct. The data is loaded into a shader program in one function only. That makes it easy for things like maybe_censor_override() to replace the whole config rather than poke only the shader requirements. This may not look like much right now, but when color management adds more uniforms and even hardcoded color need to go through the proper color pipeline, doing things the old way would become intractable. Similar simplification can be seen in draw_view(), where the RGBA->RGBX override becomes more contained. There is no longer a need to "pre-load" the shader used by triangle fan debug. Triangle fan debug no longer needs to play tricks with saving and restoring the current shader. The real benefit of this change will probably come when almost all shader operations need to take color spaces into account. That means filling in gl_shader_config parts based on a color transformation. This is based on an idea Sebastian already used in his Weston color management work. Co-authored-by: Sebastian Wick <sebastian@sebastianwick.net> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com> |
||
---|---|---|
.. | ||
backend-drm | ||
backend-fbdev | ||
backend-headless | ||
backend-rdp | ||
backend-wayland | ||
backend-x11 | ||
renderer-gl | ||
animation.c | ||
backend.h | ||
bindings.c | ||
clipboard.c | ||
compositor.c | ||
content-protection.c | ||
data-device.c | ||
dbus.c | ||
dbus.h | ||
git-version.h.meson | ||
input.c | ||
launcher-direct.c | ||
launcher-impl.h | ||
launcher-logind.c | ||
launcher-util.c | ||
launcher-util.h | ||
launcher-weston-launch.c | ||
libinput-device.c | ||
libinput-device.h | ||
libinput-seat.c | ||
libinput-seat.h | ||
libweston-internal.h | ||
linux-dmabuf.c | ||
linux-dmabuf.h | ||
linux-explicit-synchronization.c | ||
linux-explicit-synchronization.h | ||
linux-sync-file-uapi.h | ||
linux-sync-file.c | ||
linux-sync-file.h | ||
log.c | ||
meson.build | ||
noop-renderer.c | ||
pixel-formats.c | ||
pixel-formats.h | ||
pixman-renderer.c | ||
pixman-renderer.h | ||
plugin-registry.c | ||
screenshooter.c | ||
spring-tool.c | ||
timeline.c | ||
timeline.h | ||
touch-calibration.c | ||
vertex-clipping.c | ||
vertex-clipping.h | ||
weston-direct-display.c | ||
weston-launch.c | ||
weston-launch.h | ||
weston-log-file.c | ||
weston-log-flight-rec.c | ||
weston-log-internal.h | ||
weston-log-wayland.c | ||
weston-log.c | ||
zoom.c |