diff options
author | theuni <theuni-nospam-@xbmc.org> | 2011-07-09 12:00:55 -0400 |
---|---|---|
committer | theuni <theuni-nospam-@xbmc.org> | 2011-07-10 01:58:29 -0400 |
commit | 594a2d59b5cd5a2c465e8f6e3a7be9ac525ebffb (patch) | |
tree | 04c28d604031a7547da01de8746da1e43bc8c355 /system/shaders | |
parent | 0776d36e66a8f76826b63ddd9ad7decda544d0c5 (diff) |
changed: improved gles performance by avoiding bgra->rgba convert for textures
Previously, bgra textures were uploaded as rgba then converted back in
shaders. Instead, check for the existance of BGRA extensions and convert
on upload instead. If no extension is found, convert in software before
uploading.
This allows us to remove the swizzle in our shaders, which amounts to a
significant performance gain.
Diffstat (limited to 'system/shaders')
-rw-r--r-- | system/shaders/guishader_frag_multi.glsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_frag_multi_blendcolor.glsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_frag_texture.glsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_frag_texture_noblend.glsl | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/system/shaders/guishader_frag_multi.glsl b/system/shaders/guishader_frag_multi.glsl index c712e3c2f7..a5a97b5e9e 100644 --- a/system/shaders/guishader_frag_multi.glsl +++ b/system/shaders/guishader_frag_multi.glsl @@ -28,5 +28,5 @@ varying vec4 m_cord1; // SM_MULTI shader void main () { - gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).bgra; + gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).rgba; } diff --git a/system/shaders/guishader_frag_multi_blendcolor.glsl b/system/shaders/guishader_frag_multi_blendcolor.glsl index e012a6bfc5..b311350ff9 100644 --- a/system/shaders/guishader_frag_multi_blendcolor.glsl +++ b/system/shaders/guishader_frag_multi_blendcolor.glsl @@ -29,5 +29,5 @@ varying lowp vec4 m_colour; // SM_MULTI shader void main () { - gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).bgra * m_colour; + gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).rgba * m_colour; } diff --git a/system/shaders/guishader_frag_texture.glsl b/system/shaders/guishader_frag_texture.glsl index 826369fe7b..16bb84e442 100644 --- a/system/shaders/guishader_frag_texture.glsl +++ b/system/shaders/guishader_frag_texture.glsl @@ -27,5 +27,5 @@ varying lowp vec4 m_colour; // SM_TEXTURE shader void main () { - gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).bgra * m_colour); + gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba * m_colour); } diff --git a/system/shaders/guishader_frag_texture_noblend.glsl b/system/shaders/guishader_frag_texture_noblend.glsl index 16438a38ac..ed050faee2 100644 --- a/system/shaders/guishader_frag_texture_noblend.glsl +++ b/system/shaders/guishader_frag_texture_noblend.glsl @@ -26,5 +26,5 @@ varying vec4 m_cord0; // SM_TEXTURE_NOBLEND shader void main () { - gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).bgra); + gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba); } |