diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2018-05-23 11:09:11 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-06-04 13:11:03 +1000 |
commit | 6b44f3750731d50e9c54c2190999155432be027a (patch) | |
tree | ab0ebf1dd69825b59b4115dae5521fe9636b7239 | |
parent | 20960da3420e8a4bccc244b67032bed6e12f87e1 (diff) |
vrend: Remove two more BGRA formats from GLES
Remove VIRGL_FORMAT_B8G8R8A8_SRGB and VIRGL_FORMAT_B8G8R8X8_SRGB when
running on GLES because we cannot upload textures in GL_BGRA.
Mesa has been extended to use instead their RGBA counterparts.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/vrend_formats.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/vrend_formats.c b/src/vrend_formats.c index 49bbac4..390a715 100644 --- a/src/vrend_formats.c +++ b/src/vrend_formats.c @@ -231,8 +231,6 @@ static struct vrend_format_table rgtc_formats[] = { }; static struct vrend_format_table srgb_formats[] = { - { VIRGL_FORMAT_B8G8R8X8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, RGB1_SWIZZLE }, - { VIRGL_FORMAT_B8G8R8A8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, NO_SWIZZLE }, { VIRGL_FORMAT_R8G8B8X8_SRGB, GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, RGB1_SWIZZLE }, { VIRGL_FORMAT_R8G8B8A8_SRGB, GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, NO_SWIZZLE }, @@ -240,6 +238,12 @@ static struct vrend_format_table srgb_formats[] = { { VIRGL_FORMAT_L8A8_SRGB, GL_SRG8_EXT, GL_RG, GL_UNSIGNED_BYTE, RRRG_SWIZZLE }, }; +static struct vrend_format_table gl_srgb_formats[] = +{ + { VIRGL_FORMAT_B8G8R8X8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, RGB1_SWIZZLE }, + { VIRGL_FORMAT_B8G8R8A8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, NO_SWIZZLE }, +}; + static struct vrend_format_table bit10_formats[] = { { VIRGL_FORMAT_B10G10R10X2_UNORM, GL_RGB10_A2, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, RGB1_SWIZZLE }, { VIRGL_FORMAT_B10G10R10A2_UNORM, GL_RGB10_A2, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, NO_SWIZZLE }, @@ -402,11 +406,11 @@ void vrend_build_format_list_common(void) void vrend_build_format_list_gl(void) { - /* We don't want VIRGL_FORMAT_B4G4R4A4_UNORM to be supported on GLES because - * it's not as well supported as VIRGL_FORMAT_A4B4G4R4_UNORM in some - * operations. + /* GL_BGRA formats aren't as well supported in GLES as in GL, specially in + * transfer operations. So we only register support for it in GL. */ add_formats(gl_base_rgba_formats); + add_formats(gl_srgb_formats); } void vrend_build_format_list_gles(void) |