gl-renderer: use correct pixel shader for NV12 format uploaded to RG texture

Signed-off-by: Arnaud Vrac <rawoul@gmail.com>
Fixes: 00a03d2f72 ("gl-renderer: add support of WL_SHM_FORMAT_NV12")
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Arnaud Vrac 7 years ago committed by Daniel Stone
parent 49a8d9997b
commit 340d25b76f
  1. 3
      libweston/gl-renderer.c

@ -1597,7 +1597,6 @@ gl_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer,
} }
break; break;
case WL_SHM_FORMAT_NV12: case WL_SHM_FORMAT_NV12:
gs->shader = &gr->texture_shader_y_xuxv;
pitch = wl_shm_buffer_get_stride(shm_buffer); pitch = wl_shm_buffer_get_stride(shm_buffer);
gl_pixel_type = GL_UNSIGNED_BYTE; gl_pixel_type = GL_UNSIGNED_BYTE;
num_planes = 2; num_planes = 2;
@ -1606,9 +1605,11 @@ gl_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer,
gs->hsub[1] = 2; gs->hsub[1] = 2;
gs->vsub[1] = 2; gs->vsub[1] = 2;
if (gr->has_gl_texture_rg) { if (gr->has_gl_texture_rg) {
gs->shader = &gr->texture_shader_y_uv;
gl_format[0] = GL_R8_EXT; gl_format[0] = GL_R8_EXT;
gl_format[1] = GL_RG8_EXT; gl_format[1] = GL_RG8_EXT;
} else { } else {
gs->shader = &gr->texture_shader_y_xuxv;
gl_format[0] = GL_LUMINANCE; gl_format[0] = GL_LUMINANCE;
gl_format[1] = GL_LUMINANCE_ALPHA; gl_format[1] = GL_LUMINANCE_ALPHA;
} }

Loading…
Cancel
Save