i965: Support xrgb/argb2101010 formats for glx_texture_from_pixmap.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Fri, 15 Dec 2017 22:04:48 +0000 (23:04 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jan 2018 21:57:55 +0000 (22:57 +0100)
Makes compositing under X11/GLX work.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/drivers/dri/i965/intel_tex_image.c

index 37c8e24f0327f79be8ddbc31648e44d989b3b1d2..2ee36583c46dbd6048aa03ac0e759e0be8b685d4 100644 (file)
@@ -464,11 +464,19 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    if (rb->mt->cpp == 4) {
       if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
          internal_format = GL_RGB;
-         texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
+         if (rb->mt->format == MESA_FORMAT_B10G10R10X2_UNORM ||
+             rb->mt->format == MESA_FORMAT_B10G10R10A2_UNORM)
+            texFormat = MESA_FORMAT_B10G10R10X2_UNORM;
+         else
+            texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
       }
       else {
          internal_format = GL_RGBA;
-         texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
+         if (rb->mt->format == MESA_FORMAT_B10G10R10X2_UNORM ||
+             rb->mt->format == MESA_FORMAT_B10G10R10A2_UNORM)
+            texFormat = MESA_FORMAT_B10G10R10A2_UNORM;
+         else
+            texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
       }
    } else if (rb->mt->cpp == 2) {
       internal_format = GL_RGB;