[PATCH weston 5/5] gl-renderer: use correct pixel shader for NV12 format uploaded to RG texture

Arnaud Vrac rawoul at gmail.com
Wed Nov 29 14:06:42 UTC 2017


---
 libweston/gl-renderer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index 60a7bf06..4fffa78c 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -1596,7 +1596,6 @@ gl_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer,
 		}
 		break;
 	case WL_SHM_FORMAT_NV12:
-		gs->shader = &gr->texture_shader_y_xuxv;
 		pitch = wl_shm_buffer_get_stride(shm_buffer);
 		gl_pixel_type = GL_UNSIGNED_BYTE;
 		num_planes = 2;
@@ -1605,9 +1604,11 @@ gl_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer,
 		gs->hsub[1] = 2;
 		gs->vsub[1] = 2;
 		if (gr->has_gl_texture_rg) {
+			gs->shader = &gr->texture_shader_y_uv;
 			gl_format[0] = GL_R8_EXT;
 			gl_format[1] = GL_RG8_EXT;
 		} else {
+			gs->shader = &gr->texture_shader_y_xuxv;
 			gl_format[0] = GL_LUMINANCE;
 			gl_format[1] = GL_LUMINANCE_ALPHA;
 		}
-- 
2.15.0



More information about the wayland-devel mailing list