aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Wollny <gert.wollny@collabora.com>2022-12-30 12:57:36 +0100
committerMarge Bot <emma+marge@anholt.net>2023-01-02 15:23:35 +0000
commit740bbe32af648810633c92424283c699e732f62c (patch)
tree80dc0dfe7bd409451d4bb99298e533fc412f3ebc
parent0d3f8dd6b4c3e40ca65a0b8f06f15ce0dbc1afc0 (diff)
downloadvirglrenderer-740bbe32af648810633c92424283c699e732f62c.tar.gz
format: Add support for EXT_texture_sRGB_rg8
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1008>
-rw-r--r--src/gallium/auxiliary/util/u_format.csv1
-rw-r--r--src/gallium/include/pipe/p_format.h1
-rw-r--r--src/vrend_formats.c2
3 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv
index 1d743a69..f6e528a2 100644
--- a/src/gallium/auxiliary/util/u_format.csv
+++ b/src/gallium/auxiliary/util/u_format.csv
@@ -114,6 +114,7 @@ PIPE_FORMAT_I32_FLOAT , plain, 1, 1, f32 , , , , xxxx, r
PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb
PIPE_FORMAT_R8_SRGB , plain, 1, 1, un8 , , , , x001, srgb
PIPE_FORMAT_L8A8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb
+PIPE_FORMAT_R8G8_SRGB , plain, 1, 1, un8 , un8 , , , xy01, srgb
PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , xyz1, srgb
PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , xyzw, srgb
PIPE_FORMAT_A8B8G8R8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, srgb
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index 3e2d9aba..ff35c1e3 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -134,6 +134,7 @@ extern "C" {
/* sRGB formats */
#define PIPE_FORMAT_L8_SRGB VIRGL_FORMAT_L8_SRGB
#define PIPE_FORMAT_L8A8_SRGB VIRGL_FORMAT_L8A8_SRGB
+#define PIPE_FORMAT_R8G8_SRGB VIRGL_FORMAT_R8G8_SRGB
#define PIPE_FORMAT_R8G8B8_SRGB VIRGL_FORMAT_R8G8B8_SRGB
#define PIPE_FORMAT_A8B8G8R8_SRGB VIRGL_FORMAT_A8B8G8R8_SRGB
#define PIPE_FORMAT_X8B8G8R8_SRGB VIRGL_FORMAT_X8B8G8R8_SRGB
diff --git a/src/vrend_formats.c b/src/vrend_formats.c
index 67805c9c..4fa8a263 100644
--- a/src/vrend_formats.c
+++ b/src/vrend_formats.c
@@ -292,6 +292,8 @@ static struct vrend_format_table srgb_formats[] = {
{ VIRGL_FORMAT_L8_SRGB, GL_SR8_EXT, GL_RED, GL_UNSIGNED_BYTE, RRR1_SWIZZLE },
{ VIRGL_FORMAT_R8_SRGB, GL_SR8_EXT, GL_RED, GL_UNSIGNED_BYTE, NO_SWIZZLE },
+
+ { VIRGL_FORMAT_R8G8_SRGB, GL_SRG8_EXT, GL_RG, GL_UNSIGNED_BYTE, NO_SWIZZLE },
};
static struct vrend_format_table bit10_formats[] = {