From 66799c1aa09d5917a767f9d860bb693190c5a1c8 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Wed, 6 Sep 2023 13:28:26 +0200 Subject: [PATCH] multi-texture-format: Generalize shader names These shaders can be used for similar formats with other component sizes since the values are represented as floats. So whether the source value was stored in 8bit, 10bit or 16bit doesn't matter - the driver will covert it for us. Thus use a Weston-inspired, more general naming scheme. Part-of: --- src/compositor/meta-multi-texture-format.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compositor/meta-multi-texture-format.c b/src/compositor/meta-multi-texture-format.c index 0f13ab150..985d5b095 100644 --- a/src/compositor/meta-multi-texture-format.c +++ b/src/compositor/meta-multi-texture-format.c @@ -65,14 +65,14 @@ static const char y_xuxv_shader[] = "cogl_color_out = yuv_to_rgb(yuva); \n"; /* Shader for 1 Y-plane and 1 UV-plane */ -static const char nv12_shader[] = +static const char y_uv_shader[] = "vec4 yuva = vec4(0.0, 0.0, 0.0, cogl_color_in.a); \n" "yuva.x = texture2D(cogl_sampler0, cogl_tex_coord0_in.st).x; \n" "yuva.yz = texture2D(cogl_sampler1, cogl_tex_coord1_in.st).rg; \n" "cogl_color_out = yuv_to_rgb(yuva); \n"; /* Shader for 1 Y-plane, 1 U-plane and 1 V-plane */ -static const char yuv420_shader[] = +static const char y_u_v_shader[] = "vec4 yuva = vec4(0.0, 0.0, 0.0, cogl_color_in.a); \n" "yuva.x = texture2D(cogl_sampler0, cogl_tex_coord0_in.st).x; \n" "yuva.y = texture2D(cogl_sampler1, cogl_tex_coord1_in.st).x; \n" @@ -132,7 +132,7 @@ static MetaMultiTextureFormatInfo multi_format_table[] = { .plane_indices = { 0, 1 }, .hsub = { 1, 2 }, .vsub = { 1, 2 }, - .rgb_shader = nv12_shader, + .rgb_shader = y_uv_shader, .snippet_once = G_ONCE_INIT, }, /* 3 plane YUV */ @@ -143,7 +143,7 @@ static MetaMultiTextureFormatInfo multi_format_table[] = { .plane_indices = { 0, 1, 2 }, .hsub = { 1, 2, 2 }, .vsub = { 1, 2, 2 }, - .rgb_shader = yuv420_shader, + .rgb_shader = y_u_v_shader, .snippet_once = G_ONCE_INIT, }, };