[Mesa-dev] (no subject)
Tapani Pälli
tapani.palli at intel.com
Tue May 9 04:37:27 UTC 2017
Hi;
Take a look at Piglit test "ext_image_dma_buf_import-sample_yuv",
(https://cgit.freedesktop.org/piglit). Test creates EGLImage from dma
buf, binds to a texture and then samples this in a shader with
samplerExternalOES type from GL_OES_EGL_image_external extension.
On 05/09/2017 01:57 AM, Volker Vogelhuber wrote:
> I'm currently trying to render a V4L2 image with OpenGL
> on an Intel Apollo Lake using Linux 4.10 and Mesa 13.
> Supprisingly I noticed that importing a DMABUF with format
> DRM_FORMAT_YUYV into OpenGL using
> eglCreateImage/glEGLImageTargetTexture2DOES
> worked out of the box. But I noticed that there seem to be a split into
> two textures when importing the buffer. At least the nplanes
> variable in the __DRIimage's planar_format is set to 2 and in the
> intel_screen.c there is a comment for __DRI_IMAGE_FOURCC_YUYV:
> "For YUYV buffers, we set up two overlapping DRI images
> and treat them as planar buffers in the compositors."
> So far so good, but how do I access the second texture in the GLSL
> shader. I only created one texture object before calling
> glEGLImageTargetTexture2DOES with the EGLImage I got from
> eglCreateImage. And using the GLSL function texture( source, texCoord ) on this
> texture samples only the Y and U channel, what seems obvious
> as the first plane's texture is created as GL_RG texture.
> Can anyone explain to me, how one accesses the second plane.
> And if there is an example somewhere how the two planes
> have to be sampled to convert the values back to RGB, it would
> be nice if someone can send a link to such an example.
>
> Thanks
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list