formats: Add support for EXT_texture_sRGB_R8 if host supports it.

This is a GLES only extension and the format is also only supported
on a GLES host.

Enables and passes on a host that supports it:
  dEQP-GLES31.functional.texture.filtering.cube_array.formats.sr8*
  dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.*

Closes: #49

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 6 years ago committed by Jakob Bornecrantz
parent 04ecf630b7
commit abb7c520fc
  1. 1
      src/gallium/auxiliary/util/u_format.csv
  2. 2
      src/gallium/include/pipe/p_format.h
  3. 2
      src/virgl_hw.h
  4. 6
      src/vrend_formats.c

@ -112,6 +112,7 @@ PIPE_FORMAT_I32_FLOAT , plain, 1, 1, f32 , , , , xxxx, r
# SRGB formats
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_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , xyz1, srgb
PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , xyzw, srgb

Can't render this file because it contains an unexpected character in line 8 and column 3.

@ -396,6 +396,8 @@ enum pipe_format {
PIPE_FORMAT_X1B5G5R5_UNORM = 310,
PIPE_FORMAT_A4B4G4R4_UNORM = 311,
PIPE_FORMAT_R8_SRGB = 312,
PIPE_FORMAT_COUNT
};

@ -214,6 +214,8 @@ enum virgl_formats {
VIRGL_FORMAT_R10G10B10X2_UNORM = 308,
VIRGL_FORMAT_A4B4G4R4_UNORM = 311,
VIRGL_FORMAT_R8_SRGB = 312,
VIRGL_FORMAT_MAX,
};

@ -258,6 +258,11 @@ static struct vrend_format_table gl_srgb_formats[] =
{ VIRGL_FORMAT_B8G8R8A8_SRGB, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, NO_SWIZZLE },
};
static struct vrend_format_table gles_srgb_r8_format[] =
{
{ VIRGL_FORMAT_R8_SRGB, GL_SR8_EXT, GL_RED, 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 },
@ -467,6 +472,7 @@ void vrend_build_format_list_gles(void)
*/
add_formats(gles_bgra_formats);
add_formats(gles_srgb_r8_format);
/* The Z32 format is required, but OpenGL ES does not support
* using it as a depth buffer. We just fake support with Z24

Loading…
Cancel
Save