[virglrenderer-devel] [PATCH v3 2/3] vrend_formats: Replace RGB(8|16) formats with RGBX(8|16)
Gert Wollny
gert.wollny at collabora.com
Thu Jul 12 10:37:00 UTC 2018
Three component formats are not very helpful, at least the Intel driver doesn't
expose them as color renderable, and other drivers most likely also just emulate
them using RGBX textur formats. RGB32* we have to keep though because it is needed
for ARB_rbo_rgb32 which in turn is needed for OpenGL 4.0.
To handle the latter, mesa/virgl will take care that RGB32* textures are only
allocated as buffers objects.
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/virgl_hw.h | 5 +++++
src/vrend_formats.c | 10 +++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index 44c7108..738ed54 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -195,9 +195,14 @@ enum virgl_formats {
VIRGL_FORMAT_R8G8B8X8_SRGB = 230,
+ VIRGL_FORMAT_R8G8B8X8_UINT = 231,
+ VIRGL_FORMAT_R8G8B8X8_SINT = 232,
VIRGL_FORMAT_B10G10R10X2_UNORM = 233,
VIRGL_FORMAT_R16G16B16X16_UNORM = 234,
VIRGL_FORMAT_R16G16B16X16_SNORM = 235,
+ VIRGL_FORMAT_R16G16B16X16_FLOAT = 236,
+ VIRGL_FORMAT_R16G16B16X16_UINT = 237,
+ VIRGL_FORMAT_R16G16B16X16_SINT = 238,
VIRGL_FORMAT_R10G10B10A2_UINT = 253,
diff --git a/src/vrend_formats.c b/src/vrend_formats.c
index 09edc43..8f92903 100644
--- a/src/vrend_formats.c
+++ b/src/vrend_formats.c
@@ -119,10 +119,10 @@ static struct vrend_format_table integer_base_formats[] = {
};
static struct vrend_format_table integer_3comp_formats[] = {
- { VIRGL_FORMAT_R8G8B8_UINT, GL_RGB8UI, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, NO_SWIZZLE },
- { VIRGL_FORMAT_R8G8B8_SINT, GL_RGB8I, GL_RGB_INTEGER, GL_BYTE, NO_SWIZZLE },
- { VIRGL_FORMAT_R16G16B16_UINT, GL_RGB16UI, GL_RGB_INTEGER, GL_UNSIGNED_SHORT, NO_SWIZZLE },
- { VIRGL_FORMAT_R16G16B16_SINT, GL_RGB16I, GL_RGB_INTEGER, GL_SHORT, NO_SWIZZLE },
+ { VIRGL_FORMAT_R8G8B8X8_UINT, GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, RGB1_SWIZZLE },
+ { VIRGL_FORMAT_R8G8B8X8_SINT, GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE, RGB1_SWIZZLE },
+ { VIRGL_FORMAT_R16G16B16X16_UINT, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, RGB1_SWIZZLE },
+ { VIRGL_FORMAT_R16G16B16X16_SINT, GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT, RGB1_SWIZZLE },
{ VIRGL_FORMAT_R32G32B32_UINT, GL_RGB32UI, GL_RGB_INTEGER, GL_UNSIGNED_INT, NO_SWIZZLE },
{ VIRGL_FORMAT_R32G32B32_SINT, GL_RGB32I, GL_RGB_INTEGER, GL_INT, NO_SWIZZLE },
};
@@ -167,7 +167,7 @@ static struct vrend_format_table float_rg_formats[] = {
};
static struct vrend_format_table float_3comp_formats[] = {
- { VIRGL_FORMAT_R16G16B16_FLOAT, GL_RGB16F, GL_RGB, GL_HALF_FLOAT, NO_SWIZZLE },
+ { VIRGL_FORMAT_R16G16B16X16_FLOAT, GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, RGB1_SWIZZLE },
{ VIRGL_FORMAT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB, GL_FLOAT, NO_SWIZZLE },
};
--
2.17.1
More information about the virglrenderer-devel
mailing list