diff options
-rw-r--r-- | video/out/gl_video.c | 2 | ||||
-rw-r--r-- | video/out/gl_video_shaders.glsl | 29 |
2 files changed, 17 insertions, 14 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index bdca0a1ff4..4022d5fa8e 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -507,7 +507,7 @@ static void update_uniforms(struct gl_video *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/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl index 6337822c02..55258fd252 100644 --- a/video/out/gl_video_shaders.glsl +++ b/video/out/gl_video_shaders.glsl @@ -91,28 +91,31 @@ 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[4]; +uniform sampler2D texture0; +uniform sampler2D texture1; +uniform sampler2D texture2; +uniform sampler2D texture3; uniform vec2 textures_size[4]; uniform vec2 chroma_center_offset; uniform sampler1D lut_c_1d; @@ -327,22 +330,22 @@ void main() { #define USE_CONV 0 #endif #if USE_CONV == CONV_PLANAR - vec3 color = vec3(SAMPLE_L(textures[0], textures_size[0], texcoord).r, - SAMPLE_C(textures[1], textures_size[1], chr_texcoord).r, - SAMPLE_C(textures[2], textures_size[2], chr_texcoord).r); + vec3 color = vec3(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); float alpha = 1.0; #elif USE_CONV == CONV_NV12 - vec3 color = vec3(SAMPLE_L(textures[0], textures_size[0], texcoord).r, - SAMPLE_C(textures[1], textures_size[1], chr_texcoord).rg); + vec3 color = vec3(SAMPLE_L(texture0, textures_size[0], texcoord).r, + SAMPLE_C(texture1, textures_size[1], chr_texcoord).rg); float alpha = 1.0; #else - vec4 acolor = SAMPLE_L(textures[0], textures_size[0], texcoord); + vec4 acolor = SAMPLE_L(texture0, textures_size[0], texcoord); vec3 color = acolor.rgb; float alpha = acolor.a; #endif #ifdef USE_ALPHA_PLANE - alpha = SAMPLE_L(textures[USE_ALPHA_PLANE], - textures_size[USE_ALPHA_PLANE], texcoord).r; + alpha = SAMPLE_L(texture3, + textures_size[3], texcoord).r; #endif #ifdef USE_GBRP color.gbr = color; |