Commit acd29680 authored by Gert Wollny's avatar Gert Wollny Committed by Gert Wollny

mesa/st: Add support for EXT_texture_sRGB_R8

This only adds support on the Gallium core level, for the drivers
it is likely that additional changes are needed to support the
new texture format and thereby enabling the extension.

Enables on softpipe and makes pass:
  dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.*

v2: - add include for getting GL_SR8_EXT
v4: - since the extension is not required don't bother providing
      a fallback (Ilia Mirkin)
    - split patch (2/2) to separate Gallium and mesa/st parts
      (Roland Scheidegger)
    - trim commit message to only contain the history of the patch
      relevant to this part
v5: - don't include GLES headers (required enum has been added to glheader.h)
      (Ilia Mirkin)
Signed-off-by: Gert Wollny's avatarGert Wollny <gert.wollny@collabora.com>
Reviewed-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
parent 29f0ab2c
......@@ -889,6 +889,10 @@ void st_init_extensions(struct pipe_screen *screen,
PIPE_FORMAT_R8G8B8A8_SRGB},
GL_TRUE }, /* at least one format must be supported */
{ { o(EXT_texture_sRGB_R8) },
{ PIPE_FORMAT_R8_SRGB },
GL_TRUE },
{ { o(EXT_texture_type_2_10_10_10_REV) },
{ PIPE_FORMAT_R10G10B10A2_UNORM,
PIPE_FORMAT_B10G10R10A2_UNORM },
......
......@@ -169,6 +169,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
return PIPE_FORMAT_AL88_SRGB;
case MESA_FORMAT_L_SRGB8:
return PIPE_FORMAT_L8_SRGB;
case MESA_FORMAT_R_SRGB8:
return PIPE_FORMAT_R8_SRGB;
case MESA_FORMAT_BGR_SRGB8:
return PIPE_FORMAT_R8G8B8_SRGB;
case MESA_FORMAT_A8B8G8R8_SRGB:
......@@ -719,6 +721,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_A8L8_SRGB;
case PIPE_FORMAT_L8_SRGB:
return MESA_FORMAT_L_SRGB8;
case PIPE_FORMAT_R8_SRGB:
return MESA_FORMAT_R_SRGB8;
case PIPE_FORMAT_R8G8B8_SRGB:
return MESA_FORMAT_BGR_SRGB8;
case PIPE_FORMAT_ABGR8888_SRGB:
......@@ -1423,6 +1427,10 @@ static const struct format_mapping format_map[] = {
0 },
{ PIPE_FORMAT_L8_SRGB, DEFAULT_SRGBA_FORMATS }
},
{
{ GL_SR8_EXT, 0 },
{ PIPE_FORMAT_R8_SRGB, 0 }
},
/* 16-bit float formats */
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment