From ec1e384dd28089f93370d0fb8fb97934beefabb3 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Fri, 18 May 2018 14:28:58 +0200 Subject: [PATCH] vrend: Add support for VIRGL_FORMAT_R10G10B10A2_UINT As Mesa doesn't support glReadPixel with GL_BGRA_INTEGER on GLES, add this format so Virgl calls glReadPixel with GL_RGBA_INTEGER. Fixes dEQP-GLES3.functional.fbo.color.clear.rgb10_a2ui Signed-off-by: Tomeu Vizoso Tested-by: Jakob Bornecrantz --- src/virgl_hw.h | 2 ++ src/vrend_formats.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/virgl_hw.h b/src/virgl_hw.h index a430fae..ef5ce67 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -199,6 +199,8 @@ enum virgl_formats { VIRGL_FORMAT_R16G16B16X16_UNORM = 234, VIRGL_FORMAT_R16G16B16X16_SNORM = 235, + VIRGL_FORMAT_R10G10B10A2_UINT = 253, + VIRGL_FORMAT_BPTC_RGBA_UNORM = 255, VIRGL_FORMAT_BPTC_SRGBA = 256, VIRGL_FORMAT_BPTC_RGB_FLOAT = 257, diff --git a/src/vrend_formats.c b/src/vrend_formats.c index 0be213a..860b1d0 100644 --- a/src/vrend_formats.c +++ b/src/vrend_formats.c @@ -241,6 +241,7 @@ static struct vrend_format_table bit10_formats[] = { { VIRGL_FORMAT_B10G10R10A2_UINT, GL_RGB10_A2UI, GL_BGRA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV, NO_SWIZZLE }, { VIRGL_FORMAT_R10G10B10X2_UNORM, GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, RGB1_SWIZZLE }, { VIRGL_FORMAT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, NO_SWIZZLE }, + { VIRGL_FORMAT_R10G10B10A2_UINT, GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV, NO_SWIZZLE }, }; static struct vrend_format_table packed_float_formats[] = {