summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-03-27 09:59:18 -0700
committerMatt Turner <mattst88@gmail.com>2015-03-27 17:26:45 -0700
commit9fb25dec610c7db6feb9f80e5d5865d43c58f40a (patch)
tree063048cc06d2b72f20b805dd50d642bdbeec3465 /shaders
parent4d8d872770fb3fcfc3ac66f524738863b563e874 (diff)
glamor: Update shaders from upstream commit 0669babf.
commit 0669babf2b5b50cbc185b0f714671b2c2b368778 Author: Matt Turner <mattst88@gmail.com> Date: Wed Mar 4 13:42:48 2015 -0800 glamor: Perform texture2D() separately from swizzle.
Diffstat (limited to 'shaders')
-rw-r--r--shaders/glamor/73.shader_test13
-rw-r--r--shaders/glamor/74.shader_test13
2 files changed, 14 insertions, 12 deletions
diff --git a/shaders/glamor/73.shader_test b/shaders/glamor/73.shader_test
index 2d0021d..4210fc5 100644
--- a/shaders/glamor/73.shader_test
+++ b/shaders/glamor/73.shader_test
@@ -27,23 +27,24 @@ uniform int swap_rb;
#define SWAP_NONE_UPLOADING 3
void main()
{
+ vec4 color = texture2D(sampler, source_texture);
if (revert == REVERT_NONE)
{
if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING))
- gl_FragColor = texture2D(sampler, source_texture).bgra;
+ gl_FragColor = color.bgra;
else
- gl_FragColor = texture2D(sampler, source_texture).rgba;
+ gl_FragColor = color.rgba;
}
else
{
if (swap_rb == SWAP_DOWNLOADING)
- gl_FragColor = texture2D(sampler, source_texture).argb;
+ gl_FragColor = color.argb;
else if (swap_rb == SWAP_NONE_DOWNLOADING)
- gl_FragColor = texture2D(sampler, source_texture).abgr;
+ gl_FragColor = color.abgr;
else if (swap_rb == SWAP_UPLOADING)
- gl_FragColor = texture2D(sampler, source_texture).gbar;
+ gl_FragColor = color.gbar;
else if (swap_rb == SWAP_NONE_UPLOADING)
- gl_FragColor = texture2D(sampler, source_texture).abgr;
+ gl_FragColor = color.abgr;
}
}
diff --git a/shaders/glamor/74.shader_test b/shaders/glamor/74.shader_test
index b3de5e7..3c0e4d3 100644
--- a/shaders/glamor/74.shader_test
+++ b/shaders/glamor/74.shader_test
@@ -27,23 +27,24 @@ uniform int swap_rb;
#define SWAP_NONE_UPLOADING 3
void main()
{
+ vec4 color = texture2D(sampler, source_texture);
if (revert == REVERT_NONE)
{
if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING))
- gl_FragColor = vec4(texture2D(sampler, source_texture).bgr, 1);
+ gl_FragColor = vec4(color.bgr, 1);
else
- gl_FragColor = vec4(texture2D(sampler, source_texture).rgb, 1);
+ gl_FragColor = vec4(color.rgb, 1);
}
else
{
if (swap_rb == SWAP_DOWNLOADING)
- gl_FragColor = vec4(1, texture2D(sampler, source_texture).rgb);
+ gl_FragColor = vec4(1, color.rgb);
else if (swap_rb == SWAP_NONE_DOWNLOADING)
- gl_FragColor = vec4(1, texture2D(sampler, source_texture).bgr);
+ gl_FragColor = vec4(1, color.bgr);
else if (swap_rb == SWAP_UPLOADING)
- gl_FragColor = vec4(texture2D(sampler, source_texture).gba, 1);
+ gl_FragColor = vec4(color.gba, 1);
else if (swap_rb == SWAP_NONE_UPLOADING)
- gl_FragColor = vec4(texture2D(sampler, source_texture).abg, 1);
+ gl_FragColor = vec4(color.abg, 1);
}
}