vrend: Add VIRGL_FORMAT_R8G8B8A8_SRGB format and test for more sRGB formats

This along with another patch allows us to expose
GL_[EXT|ARB]_framebuffer_sRGB on a GLES host.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Jakob Bornecrantz 7 years ago
parent 25165ad72a
commit e57359eeb4
  1. 1
      src/virgl_hw.h
  2. 2
      src/vrend_formats.c

@ -85,6 +85,7 @@ enum virgl_formats {
VIRGL_FORMAT_L8A8_SRGB = 96,
VIRGL_FORMAT_B8G8R8A8_SRGB = 100,
VIRGL_FORMAT_B8G8R8X8_SRGB = 101,
VIRGL_FORMAT_R8G8B8A8_SRGB = 104,
/* compressed formats */
VIRGL_FORMAT_DXT1_RGB = 105,

@ -226,10 +226,10 @@ 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 },
{ VIRGL_FORMAT_L8_SRGB, GL_SR8_EXT, GL_RED, GL_UNSIGNED_BYTE, RRR1_SWIZZLE },
{ VIRGL_FORMAT_L8A8_SRGB, GL_SRG8_EXT, GL_RG, GL_UNSIGNED_BYTE, RRRG_SWIZZLE },

Loading…
Cancel
Save