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;