> Out of pure curiosity... on which SoC/desktop-GPUs did you check this?
Mali-400 MP and Intel Ironlake (Arrandale) Mobile. Some interesting observations:
* On both GPUs replacing "gl_FragColor = alpha * frag" with "gl_FragColor = frag" has no performance effect. That is, for our simple shader, the muplication is performed for "free". Just this indicates that there is no point in trying to improve the shader.
* On Ironlake using the if clause version reduces the performance noticeably, whereas on Mali-400 MP it has no effect at all.
If you want to experiment further, I have found the glmark2 "effects2d" benchmark to be good starting point. Just edit the data/shaders/effect-2d-convolution.frag shader to your liking (don't forget to remove the $convolution$ replacement variable) and adjust the source code accordingly if you introduce any "uniform" variables. There is also the --off-screen option which renders to an offs-creen surface if the on-screen results are too unstable.
> Out of pure curiosity... on which SoC/desktop-GPUs did you check this?
Mali-400 MP and Intel Ironlake (Arrandale) Mobile. Some interesting observations:
* On both GPUs replacing "gl_FragColor = alpha * frag" with "gl_FragColor = frag" has no performance effect. That is, for our simple shader, the muplication is performed for "free". Just this indicates that there is no point in trying to improve the shader.
* On Ironlake using the if clause version reduces the performance noticeably, whereas on Mali-400 MP it has no effect at all.
If you want to experiment further, I have found the glmark2 "effects2d" benchmark to be good starting point. Just edit the data/shaders/ effect- 2d-convolution. frag shader to your liking (don't forget to remove the $convolution$ replacement variable) and adjust the source code accordingly if you introduce any "uniform" variables. There is also the --off-screen option which renders to an offs-creen surface if the on-screen results are too unstable.