[Mesa-dev] [PATCH 02/10] i965: Support XRGB2101010 and ARGB2101010 compositing under DRI2.
Mario Kleiner
mario.kleiner.de at gmail.com
Tue Sep 5 05:01:06 UTC 2017
This works well as tested under Compiz, KDE-5, Gnome-Shell.
Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
---
src/mesa/drivers/dri/i965/intel_blit.c | 8 ++++++++
src/mesa/drivers/dri/i965/intel_tex_image.c | 12 ++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 819a3da..b324c47 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -161,6 +161,14 @@ intel_miptree_blit_compatible_formats(mesa_format src, mesa_format dst)
return (dst == MESA_FORMAT_R8G8B8A8_UNORM ||
dst == MESA_FORMAT_R8G8B8X8_UNORM);
+ if (src == MESA_FORMAT_B10G10R10A2_UNORM || src == MESA_FORMAT_B10G10R10X2_UNORM)
+ return (dst == MESA_FORMAT_B10G10R10A2_UNORM ||
+ dst == MESA_FORMAT_B10G10R10X2_UNORM);
+
+ if (src == MESA_FORMAT_R10G10B10A2_UNORM || src == MESA_FORMAT_R10G10B10X2_UNORM)
+ return (dst == MESA_FORMAT_R10G10B10A2_UNORM ||
+ dst == MESA_FORMAT_R10G10B10X2_UNORM);
+
return false;
}
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 4661581..405de99 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -246,11 +246,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;
--
2.7.4
More information about the mesa-dev
mailing list