weston/libweston
Harish Krupo 7903c5e667 gl-renderer: Requirement based shader generation
This patch modifies the shader generation code so that the shaders are
stitched together based on the requirement instead of creating them
during initialization. This is necessary for HDR use cases where each
surface would have different properties based on which different
de-gamma or tone mapping or gamma shaders are stitched together.

v2: Use /* */ instead of // (Pekka)
    Move shader strings to gl-shaders.c file (Pekka)
    Remove Makefile.am changes (Pekka)
    Use a struct instead of uint32_t for storing requirements (Pekka)
    Clean up shader list on destroy (Pekka)
    Rename shader_release -> shader_destroy (Pekka)
    Move shader creation/deletion into gl-shaders.c (Pekka)
    Use create_shaders's multi string capbility instead of
    concatenating (Pekka)

v3: Add length check when adding shader string (Pekka)

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>

v4: Rebased, PROTECTION_MODE_ENFORCED converted.
    Dropped unnecessary { }.
    Ported setup_censor_overrides().
    Split out moving code into gl-shaders.c.
    Changed to follow "gl-renderer: rewrite fragment shaders",
    no more shader source stitching.
    Added SHADER_VARIANT_XYUV.
    Const'fy function arguments.
    Added gl_shader_requirements_cmp() and moved the early return in
    use_gl_program().
    Moved use_gl_program() before first use in file.
    Split solid shader requirements by use case: requirements_censor and
    requirements_triangle_fan.
    Simplified fragment_debug_binding() since no need to force anything.

    Ensure struct gl_shader_requirements has no padding. This allows us
    to use normal C syntax instead of memset() and memcpy() when
    initializing or assigning. See also:
    https://gitlab.freedesktop.org/mesa/mesa/-/issues/2071
    Make it also a bitfield to squeeze the size.

v5: Move wl_list_insert() into gl_shader_create() (Daniel)
    Compare variant to explicit value. (Daniel)
    Change functions to gl_renderer_get_program,
    gl_renderer_use_program, and
    gl_renderer_use_program_with_view_uniforms.
    Use local variable instead of gr->current_shader. (Daniel)
    Simplified gl_renderer_get_program.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
..
backend-drm drm-backend: do not skip renderer if capturing screen 2021-02-25 12:47:07 +02:00
backend-fbdev pixman-renderer: Replace output-create flags with struct 2020-03-20 15:25:24 +00:00
backend-headless backend-headless: NULL check after wl_event_loop_add_timer 2020-11-06 16:13:24 +00:00
backend-rdp backend-rdp: release seat on peer disconnect 2020-10-16 12:11:27 +00:00
backend-wayland backend-wayland: Abort early when wl_shm isn’t advertised 2021-02-12 12:31:26 +01:00
backend-x11 pixman-renderer: Replace output-create flags with struct 2020-03-20 15:25:24 +00:00
renderer-gl gl-renderer: Requirement based shader generation 2021-02-25 13:16:02 +02:00
animation.c libweston: add missing include 2020-01-29 09:49:41 +00:00
backend.h libweston: Add transform to weston_head 2020-03-06 21:50:38 +00:00
bindings.c libweston: add missing include 2020-01-29 09:49:41 +00:00
clipboard.c libweston: add missing include 2020-01-29 09:49:41 +00:00
compositor.c libweston: fix typos 2021-02-24 10:01:17 -05:00
content-protection.c libweston: fix typos 2021-02-24 10:01:17 -05:00
data-device.c libweston: constify data_source_interface 2020-10-21 14:18:30 +03:00
dbus.c dbus: Don't return value from void function 2019-06-11 11:31:04 +01:00
dbus.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
git-version.h.meson Add Meson build system 2018-12-09 14:50:54 +02:00
input.c libweston: Send wl_keyboard.modifiers after wl_keyboard.enter 2020-07-09 17:47:11 +03:00
launcher-direct.c launcher-direct: handle seat0 without VTs 2021-01-21 09:02:26 +00:00
launcher-impl.h launcher: Add more error logging to launcher backends 2020-12-16 07:23:02 +00:00
launcher-logind.c launcher-logind: handle any seat without VTs 2021-01-21 09:02:26 +00:00
launcher-util.c launcher: Add more error logging to launcher backends 2020-12-16 07:23:02 +00:00
launcher-util.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
launcher-weston-launch.c launcher: Add more error logging to launcher backends 2020-12-16 07:23:02 +00:00
libinput-device.c libweston/libinput-device: Enable/Set pointer capabilities only on pointer movement 2020-12-08 17:54:55 +02:00
libinput-device.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
libinput-seat.c libweston: Remove internal weston-log set-up function out of public header 2019-07-18 13:34:04 +03:00
libinput-seat.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
libweston-internal.h libweston: Add the ability to determine if a dmabuf is scanout-capable 2019-11-21 13:54:50 +02:00
linux-dmabuf.c libweston: Add the ability to determine if a dmabuf is scanout-capable 2019-11-21 13:54:50 +02:00
linux-dmabuf.h libweston: Add weston-direct-display server side implementation 2019-11-18 19:33:09 +02:00
linux-explicit-synchronization.c libweston: Advertise minor version 2 of zwp_linux_explicit_synchronization_v1 2019-08-02 15:00:08 +00:00
linux-explicit-synchronization.h libweston: Support zwp_surface_synchronization_v1.set_acquire_fence 2019-02-06 12:21:56 +00:00
linux-sync-file-uapi.h libweston: Introduce an internal linux sync file API 2019-02-06 12:21:56 +00:00
linux-sync-file.c libweston: export weston_linux_sync_file_read_timestamp() 2019-04-18 12:50:55 +03:00
linux-sync-file.h libweston: export weston_linux_sync_file_read_timestamp() 2019-04-18 12:50:55 +03:00
log.c libweston: add missing include 2020-01-29 09:49:41 +00:00
meson.build libweston: Add weston-direct-display server side implementation 2019-11-18 19:33:09 +02:00
noop-renderer.c libweston: add missing include 2020-01-29 09:49:41 +00:00
pixel-formats.c Unify the include style of shared/ headers 2019-10-04 16:04:48 +03:00
pixel-formats.h pixel-formats: add RGBA bits and type fields 2019-10-04 12:17:18 +03:00
pixman-renderer.c pixman-renderer: Replace output-create flags with struct 2020-03-20 15:25:24 +00:00
pixman-renderer.h pixman-renderer: Replace output-create flags with struct 2020-03-20 15:25:24 +00:00
plugin-registry.c Rename plugin-registry.h to libweston/plugin-registry.h 2019-04-18 12:31:46 +03:00
screenshooter.c libweston: do not damage on screenshot 2021-02-25 12:47:07 +02:00
spring-tool.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
timeline.c libweston: fix typos 2021-02-24 10:01:17 -05:00
timeline.h libweston: move TYPEVERIFY macro into shared 2021-02-17 12:52:33 +00:00
touch-calibration.c libweston: don't clean up surface role 2020-06-12 09:23:11 +00:00
vertex-clipping.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vertex-clipping.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
weston-direct-display.c libweston: Add weston-direct-display server side implementation 2019-11-18 19:33:09 +02:00
weston-launch.c launcher-weston-launch: avoid race condition when switching VT merge 2020-01-30 12:11:37 +00:00
weston-launch.h launcher-weston-launch: avoid race condition when switching VT merge 2020-01-30 12:11:37 +00:00
weston-log-file.c weston-log: destroy subscriptions with destruction of subscribers 2020-02-10 10:53:50 +00:00
weston-log-flight-rec.c weston-log: destroy subscriptions with destruction of subscribers 2020-02-10 10:53:50 +00:00
weston-log-internal.h weston-log-wayland: make stream_destroy() use weston_log_subscriber_release() 2020-02-10 10:53:50 +00:00
weston-log-wayland.c weston-log-wayland: make stream_destroy() use weston_log_subscriber_release() 2020-02-10 10:53:50 +00:00
weston-log.c libweston: fix typos 2021-02-24 10:01:17 -05:00
zoom.c libweston: Add functions to modify disable_planes counter for an output 2019-08-26 16:18:22 +05:30