diff options
author | theuni <theuni-nospam-@xbmc.org> | 2011-11-27 11:57:56 -0500 |
---|---|---|
committer | Trent Nelson <trent.a.b.nelson@gmail.com> | 2013-09-13 18:02:45 -0400 |
commit | 3c2ebbae1f826ce51d50a0dd8db0523dddf31cfd (patch) | |
tree | 1d3f0dcb6f30158c1c65bdc66ab55071d74f4ca9 /system/shaders | |
parent | 597fb4fcaf992f012caad53da8cb48d1fa18ce69 (diff) |
[GLES] speed up blending
(texture * color) costs us an extra operation on Mali when sent as varying.
Instead, since textures use the same color for the entire render, send it as
a uniform instead.
This does not apply to fonts, since the font and its shadow are rendered
together, and may not share a color (tested and looks bad).
This increases fps anywhere heavy blending is done.
Diffstat (limited to 'system/shaders')
-rw-r--r-- | system/shaders/guishader_frag_multi_blendcolor.glsl | 4 | ||||
-rw-r--r-- | system/shaders/guishader_frag_texture.glsl | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/system/shaders/guishader_frag_multi_blendcolor.glsl b/system/shaders/guishader_frag_multi_blendcolor.glsl index 7dc909b3c8..8101970110 100644 --- a/system/shaders/guishader_frag_multi_blendcolor.glsl +++ b/system/shaders/guishader_frag_multi_blendcolor.glsl @@ -23,10 +23,10 @@ uniform sampler2D m_samp0; uniform sampler2D m_samp1; varying vec4 m_cord0; varying vec4 m_cord1; -varying lowp vec4 m_colour; +uniform lowp vec4 m_unicol; // SM_MULTI shader void main () { - gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).rgba * m_colour; + gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).rgba * m_unicol; } diff --git a/system/shaders/guishader_frag_texture.glsl b/system/shaders/guishader_frag_texture.glsl index e71716e5bd..9939feb470 100644 --- a/system/shaders/guishader_frag_texture.glsl +++ b/system/shaders/guishader_frag_texture.glsl @@ -20,11 +20,11 @@ precision mediump float; uniform sampler2D m_samp0; +uniform lowp vec4 m_unicol; varying vec4 m_cord0; -varying lowp vec4 m_colour; // SM_TEXTURE shader void main () { - gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba * m_colour); + gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba * m_unicol); } |