[virglrenderer-devel] [PATCH] vrend: Add VIRGL_FORMAT_R8G8B8A8_SRGB format and test for more sRGB formats

Jakob Bornecrantz jakob at collabora.com
Tue Apr 3 16:08:59 UTC 2018


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

Signed-off-by: Jakob Bornecrantz <jakob at collabora.com>
---
 src/virgl_hw.h      | 1 +
 src/vrend_formats.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index 7cbbeee..221f3fd 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -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,
diff --git a/src/vrend_formats.c b/src/vrend_formats.c
index aea634a..54a6ab3 100644
--- a/src/vrend_formats.c
+++ b/src/vrend_formats.c
@@ -219,10 +219,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 },
   { VIRGL_FORMAT_B8G8R8A8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE },
+  { VIRGL_FORMAT_B8G8R8X8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE },
   { VIRGL_FORMAT_R8G8B8X8_SRGB, GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE },
+  { VIRGL_FORMAT_R8G8B8A8_SRGB, GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE },
 
   { VIRGL_FORMAT_L8_SRGB, GL_SLUMINANCE8_EXT, GL_LUMINANCE, GL_UNSIGNED_BYTE },
   { VIRGL_FORMAT_L8A8_SRGB, GL_SLUMINANCE8_ALPHA8_EXT, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE },
-- 
2.14.1



More information about the virglrenderer-devel mailing list