7ef26886f5
Proper color management will need blending done with linear light pixel values, that is, EOTF applied before blending, and then inverse-EOTF applied for scanout after blending. The simplest way to set that up is to use an intemediate framebuffer a.k.a shadow buffer containing the composited image in linear light values, then blit from that to the actual framebuffer. This patch implements the shadow buffer, but the linear light blending is left for another patch. This allows GL-renderer to turn WESTON_CAP_COLOR_OPS on. Half-float is chosen as the buffer format because linear light values require more bits to encode with sufficient precision than the usual non-linear pixel values. v2: Use /* */ instead of // (Pekka) Rename fbo and tex to shadow_{fbo,tex} (Pekka) Check for OpenGLES capabilities before creating shadow_{tex,fbo} (Pekka) Signed-off-by: Harish Krupo <harishkrupo@gmail.com> v3: Rebased. Simplified GL version checks (Sebastian) Apply changes from "libweston: add color ops cap and bool renderer shadow buffer" Renamed supports_half_float_texture to has_gl_half_float to follow the existing naming pattern. Introduce gl_renderer_create_shadow_16f(). Undo moving of glViewport() call. Replace half_float_texture_enabled with shadow_exists(). Introduce struct gl_output_state_shadow. Assert no resizing with shadow. Fix triangle fan debug. Rename repaint_from_texture() to blit_shadow_to_output(). Rewrite commit message because linear light blending is not implemented in this patch. Fix blit_shadow_to_output() for scaled/transformed outputs and remove redundant code. Fix has_gl_half_float determination. v4: Disable blending in blit_shadow. (Daniel) Port to gl_renderer_get_program(). Make a generic fbo-texture struct with parameterized format. (Daniel) Change has_gl_half_float into gl_half_float_type. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com> |
||
---|---|---|
.. | ||
egl-glue.c | ||
fragment.glsl | ||
gl-renderer-internal.h | ||
gl-renderer.c | ||
gl-renderer.h | ||
gl-shaders.c | ||
meson.build | ||
vertex.glsl |