summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video_shaders.glsl
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-18 14:46:19 +0100
committerwm4 <wm4@nowhere>2014-12-18 14:46:59 +0100
commit541f6731a02c9b1b82770630a159a76e75c060ef (patch)
tree679784d130f3b4d482a62887d6687eaaacb09087 /video/out/gl_video_shaders.glsl
parentd910a0faa82f064ebe0cfbae56a9c82a0c18f32f (diff)
downloadmpv-541f6731a02c9b1b82770630a159a76e75c060ef.tar.bz2
mpv-541f6731a02c9b1b82770630a159a76e75c060ef.tar.xz
vo_opengl: simplify the case without texture_rg
If GL_RED was not available, we used GL_ALPHA. But this is an unnecessary complication, and it's easier to use GL_LUMINANCE instead. With the latter, a texture will return the .r component set, and as long as the shader doesn't look at the other components, the shader doesn't need any changes. Some of the changes added in 0e8fbdbd are now unneeeded. Also, realign the entire gl_byte_formats_legacy table.
Diffstat (limited to 'video/out/gl_video_shaders.glsl')
-rw-r--r--video/out/gl_video_shaders.glsl16
1 files changed, 7 insertions, 9 deletions
diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl
index 7f77be0421..322c91fd13 100644
--- a/video/out/gl_video_shaders.glsl
+++ b/video/out/gl_video_shaders.glsl
@@ -46,10 +46,8 @@ precision mediump float;
#endif
#if HAVE_RG
-#define R r
#define RG rg
#else
-#define R a
#define RG ra
#endif
@@ -145,7 +143,7 @@ in vec4 color;
DECLARE_FRAGPARMS
void main() {
- out_color = vec4(color.rgb, color.a * texture(texture0, texcoord).R);
+ out_color = vec4(color.rgb, color.a * texture(texture0, texcoord).r);
}
#!section frag_osd_rgba
@@ -338,12 +336,12 @@ void main() {
#define USE_CONV 0
#endif
#if USE_CONV == CONV_PLANAR
- vec4 acolor = vec4(SAMPLE_L(texture0, textures_size[0], texcoord).R,
- SAMPLE_C(texture1, textures_size[1], chr_texcoord).R,
- SAMPLE_C(texture2, textures_size[2], chr_texcoord).R,
+ vec4 acolor = vec4(SAMPLE_L(texture0, textures_size[0], texcoord).r,
+ SAMPLE_C(texture1, textures_size[1], chr_texcoord).r,
+ SAMPLE_C(texture2, textures_size[2], chr_texcoord).r,
1.0);
#elif USE_CONV == CONV_NV12
- vec4 acolor = vec4(SAMPLE_L(texture0, textures_size[0], texcoord).R,
+ vec4 acolor = vec4(SAMPLE_L(texture0, textures_size[0], texcoord).r,
SAMPLE_C(texture1, textures_size[1], chr_texcoord).RG,
1.0);
#else
@@ -353,7 +351,7 @@ void main() {
acolor = acolor. USE_COLOR_SWIZZLE ;
#endif
#ifdef USE_ALPHA_PLANE
- acolor.a = SAMPLE_L(texture3, textures_size[3], texcoord).R;
+ acolor.a = SAMPLE_L(texture3, textures_size[3], texcoord).r;
#endif
vec3 color = acolor.rgb;
float alpha = acolor.a;
@@ -464,7 +462,7 @@ void main() {
#ifdef USE_TEMPORAL_DITHER
dither_pos = dither_trafo * dither_pos;
#endif
- float dither_value = texture(dither, dither_pos).R;
+ float dither_value = texture(dither, dither_pos).r;
color = floor(color * dither_quantization + dither_value + dither_center) /
dither_quantization;
#endif