gl-renderer: add shader bit input_is_premult
Add a new shader requirements bit input_is_premult which says whether
the texture sampling results in premultiplied alpha or not. Currently
this can be deduced fully from the shader texture variant, but in the
future there might a protocol extension to explicitly control it. Hence
the need for a new bit.
yuva2rgba() is changed to produce straight alpha always. This makes
sample_input_texture() sometimes produce straight or premultiplied
alpha. The input_is_premult bit needs to match sample_input_texture()
behavior. Doing this should save three multiplications in the shader for
straight alpha formats.
pipeline_premult() function is added, because in the future another
pipeline working on straight alpha will be needed.
Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.com>
parent
819054ce
No related branches found
No related tags found
This commit is part of merge request !637. Comments created here will be created in the context of that merge request.
Showing
- libweston/renderer-gl/fragment.glsl 19 additions, 4 deletionslibweston/renderer-gl/fragment.glsl
- libweston/renderer-gl/gl-renderer-internal.h 5 additions, 1 deletionlibweston/renderer-gl/gl-renderer-internal.h
- libweston/renderer-gl/gl-renderer.c 6 additions, 0 deletionslibweston/renderer-gl/gl-renderer.c
- libweston/renderer-gl/gl-shaders.c 24 additions, 1 deletionlibweston/renderer-gl/gl-shaders.c
Please register or sign in to comment