summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-05 23:10:02 +0100
committerwm4 <wm4@nowhere>2013-03-05 23:42:39 +0100
commit3dcc83a70609d392c8ecd917dd5c16995424e9c4 (patch)
tree02756584d8be07df5bd5e89afa89c74e6ed5a74b /video
parent3a0d647e0fd773a1ddd535ef21301b9f3d1fb58f (diff)
downloadmpv-3dcc83a70609d392c8ecd917dd5c16995424e9c4.tar.bz2
mpv-3dcc83a70609d392c8ecd917dd5c16995424e9c4.tar.xz
vo_opengl: avoid texture arrays for compatibility with Intel low quality crap
Commit a0b43a1 changed textures to an array, because additional per-texture information was needed and managing this as array is more elegant. This broke playback on Windows with Intel drivers (window shows green video, even though subtitles/OSD work correctly). So change it back to make it work again. Affected driver: Intel(R) HD Graphics 3000 9.17.10.2932
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_opengl.c2
-rw-r--r--video/out/vo_opengl_shaders.glsl20
2 files changed, 12 insertions, 10 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index dbaede4461..669bd46ceb 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -450,7 +450,7 @@ static void update_uniforms(struct gl_priv *p, GLuint program)
for (int n = 0; n < p->plane_count; n++) {
char textures_n[32];
char textures_size_n[32];
- snprintf(textures_n, sizeof(textures_n), "textures[%d]", n);
+ snprintf(textures_n, sizeof(textures_n), "texture%d", n);
snprintf(textures_size_n, sizeof(textures_size_n), "textures_size[%d]", n);
gl->Uniform1i(gl->GetUniformLocation(program, textures_n), n);
diff --git a/video/out/vo_opengl_shaders.glsl b/video/out/vo_opengl_shaders.glsl
index 13595ec77e..677b2f5679 100644
--- a/video/out/vo_opengl_shaders.glsl
+++ b/video/out/vo_opengl_shaders.glsl
@@ -87,28 +87,30 @@ void main() {
}
#!section frag_osd_libass
-uniform sampler2D textures[3];
+uniform sampler2D texture0;
in vec2 texcoord;
in vec4 color;
DECLARE_FRAGPARMS
void main() {
- out_color = vec4(color.rgb, color.a * texture(textures[0], texcoord).r);
+ out_color = vec4(color.rgb, color.a * texture(texture0, texcoord).r);
}
#!section frag_osd_rgba
-uniform sampler2D textures[3];
+uniform sampler2D texture0;
in vec2 texcoord;
DECLARE_FRAGPARMS
void main() {
- out_color = texture(textures[0], texcoord);
+ out_color = texture(texture0, texcoord);
}
#!section frag_video
-uniform sampler2D textures[3];
+uniform sampler2D texture0;
+uniform sampler2D texture1;
+uniform sampler2D texture2;
uniform vec2 textures_size[3];
uniform sampler1D lut_c_1d;
uniform sampler1D lut_l_1d;
@@ -313,11 +315,11 @@ vec4 sample_sharpen5(sampler2D tex, vec2 texsize, vec2 texcoord) {
void main() {
#ifdef USE_PLANAR
- vec3 color = vec3(SAMPLE_L(textures[0], textures_size[0], texcoord).r,
- SAMPLE_C(textures[1], textures_size[1], texcoord).r,
- SAMPLE_C(textures[2], textures_size[2], texcoord).r);
+ vec3 color = vec3(SAMPLE_L(texture0, textures_size[0], texcoord).r,
+ SAMPLE_C(texture1, textures_size[1], texcoord).r,
+ SAMPLE_C(texture2, textures_size[2], texcoord).r);
#else
- vec3 color = SAMPLE_L(textures[0], textures_size[0], texcoord).rgb;
+ vec3 color = SAMPLE_L(texture0, textures_size[0], texcoord).rgb;
#endif
#ifdef USE_GBRP
color.gbr = color;