summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}