Skip to content
Commit f31de214 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Marius Vlad
Browse files

gl-renderer: fix performance regression in frag

When color management is disabled, the fragment shader was still first
ensuring straight alpha and then immediately just going back to
pre-multiplied. This is near-impossible for a shader compiler to
optimize out, I guess because of the if-statement to handle division by
zero. Having view alpha applied in between certainly didn't make it
easier.

That causes extra fragment computations that are unnecessary. In the
issue report this was found to cause a notable performance regression.

Fix the performance regression by introducing special-case paths for
when straight alpha is not needed. This skips the unnecessary
computations.

Fixes: #623


Fixes: 9a6a4e70

Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 6234cb98)

Dropped SHADER_COLOR_MAPPING_IDENTITY as that is not available in weston
10.0.
parent f7c5fa17
Loading
Loading
Loading
Pipeline #606118 failed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment