Skip to content

shaped-texture: Use the REPLACE combine function on opaque areas

Daniel van Vugt requested to merge vanvugt/mutter:faster-opaque into master

We were setting the pipeline colour to all white (1.0, 1.0, 1.0, 1.0) and so the default layer combine function multiplied each pixel (R, G, B, A) by all ones. Obviously multiplying by one four times per pixel is a waste of effort so we remove the colour setting and set the layer combine function to a trivial shader that will ignore whatever the current pipeline colour is set to. So now we do zero multiplies per pixel.

On an i7-7700 at UHD 3840x2160 this results in 5% faster render times and 10% lower power usage (says intel_gpu_top). The benefit is probably much higher for virtual machines though, as they're no longer being asked to do CPU-based math on every pixel of a window.

Edited by Daniel van Vugt

Merge request reports