summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-05-01 11:16:20 -0700
committerEric Anholt <[email protected]>2017-10-10 09:31:29 -0700
commitef874ee450b18e6d6189731f3160c56474bacbf5 (patch)
tree7cbbeabefe1020d7854b07586411690dbe5c2604 /src/mesa
parent30782962263d21e984826aef616e25f4ec82de2d (diff)
gallium: Add support for 5551 with the 1-bit field in the low bit.
This is how VC4 stores 5551 textures, which we need to support for GL_OES_required_internalformat. v2: Extend commit message, fix svga driver build, add BE ordering from Roland. v3: Rebase on PIPE_FORMAT_R10G10B10X2_UNORM addition. Reviewed-by: Marek Olšák <[email protected]> (v2) Reviewed-by: Nicolai Hähnle <[email protected]> (v2)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_format.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 65be09cbde2..1ae677d33c5 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -79,6 +79,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st, mesa_format mesaForma
return PIPE_FORMAT_XRGB8888_UNORM;
case MESA_FORMAT_B5G5R5A1_UNORM:
return PIPE_FORMAT_B5G5R5A1_UNORM;
+ case MESA_FORMAT_A1B5G5R5_UNORM:
+ return PIPE_FORMAT_A1B5G5R5_UNORM;
case MESA_FORMAT_B4G4R4A4_UNORM:
return PIPE_FORMAT_B4G4R4A4_UNORM;
case MESA_FORMAT_B5G6R5_UNORM:
@@ -409,6 +411,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st, mesa_format mesaForma
return PIPE_FORMAT_B4G4R4X4_UNORM;
case MESA_FORMAT_B5G5R5X1_UNORM:
return PIPE_FORMAT_B5G5R5X1_UNORM;
+ case MESA_FORMAT_X1B5G5R5_UNORM:
+ return PIPE_FORMAT_X1B5G5R5_UNORM;
case MESA_FORMAT_R8G8B8X8_SNORM:
return PIPE_FORMAT_RGBX8888_SNORM;
case MESA_FORMAT_X8B8G8R8_SNORM:
@@ -558,6 +562,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_X8R8G8B8_UNORM;
case PIPE_FORMAT_B5G5R5A1_UNORM:
return MESA_FORMAT_B5G5R5A1_UNORM;
+ case PIPE_FORMAT_A1B5G5R5_UNORM:
+ return MESA_FORMAT_A1B5G5R5_UNORM;
case PIPE_FORMAT_B4G4R4A4_UNORM:
return MESA_FORMAT_B4G4R4A4_UNORM;
case PIPE_FORMAT_B5G6R5_UNORM:
@@ -890,6 +896,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_B4G4R4X4_UNORM;
case PIPE_FORMAT_B5G5R5X1_UNORM:
return MESA_FORMAT_B5G5R5X1_UNORM;
+ case PIPE_FORMAT_X1B5G5R5_UNORM:
+ return MESA_FORMAT_X1B5G5R5_UNORM;
case PIPE_FORMAT_RGBX8888_SNORM:
return MESA_FORMAT_R8G8B8X8_SNORM;
case PIPE_FORMAT_XBGR8888_SNORM:
@@ -1150,7 +1158,8 @@ static const struct format_mapping format_map[] = {
},
{
{ GL_RGB5_A1, 0 },
- { PIPE_FORMAT_B5G5R5A1_UNORM, DEFAULT_RGBA_FORMATS }
+ { PIPE_FORMAT_B5G5R5A1_UNORM, PIPE_FORMAT_A1B5G5R5_UNORM,
+ DEFAULT_RGBA_FORMATS }
},
{
{ GL_R3_G3_B2, 0 },
@@ -1164,7 +1173,8 @@ static const struct format_mapping format_map[] = {
},
{
{ GL_RGB5 },
- { PIPE_FORMAT_B5G5R5X1_UNORM, PIPE_FORMAT_B5G5R5A1_UNORM,
+ { PIPE_FORMAT_B5G5R5X1_UNORM, PIPE_FORMAT_X1B5G5R5_UNORM,
+ PIPE_FORMAT_B5G5R5A1_UNORM, PIPE_FORMAT_A1B5G5R5_UNORM,
DEFAULT_RGB_FORMATS }
},
{