summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-07-28 15:57:23 -0600
committerBrian Paul <[email protected]>2016-06-10 15:50:04 -0600
commite295b4e800a0595f96d775ebd383b8a358f8fdbc (patch)
treecbe313d0fdf4eb93775014cf1c0a18d72835da62 /src/mesa
parentdd4be2e19a2261c9b60be4bb6e6268c7fd0c0bce (diff)
st/mesa: tweak surface format mapping table
1. Try to choose R8G8B8A8 unorm/srgb formats before others in an effort to try to match component ordering for UINT/SINT/etc. 2. If we can't get a format such as PIPE_FORMAT_A16_UNORM, try PIPE_FORMAT_R16G16B16A16_UNORM before shallower formats. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_format.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 9a280fc004b..acb7725ab69 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1062,23 +1062,23 @@ struct format_mapping
#define DEFAULT_RGBA_FORMATS \
- PIPE_FORMAT_B8G8R8A8_UNORM, \
PIPE_FORMAT_R8G8B8A8_UNORM, \
+ PIPE_FORMAT_B8G8R8A8_UNORM, \
PIPE_FORMAT_A8R8G8B8_UNORM, \
PIPE_FORMAT_A8B8G8R8_UNORM, \
0
#define DEFAULT_RGB_FORMATS \
- PIPE_FORMAT_B8G8R8X8_UNORM, \
PIPE_FORMAT_R8G8B8X8_UNORM, \
+ PIPE_FORMAT_B8G8R8X8_UNORM, \
PIPE_FORMAT_X8R8G8B8_UNORM, \
PIPE_FORMAT_X8B8G8R8_UNORM, \
PIPE_FORMAT_B5G6R5_UNORM, \
DEFAULT_RGBA_FORMATS
#define DEFAULT_SRGBA_FORMATS \
- PIPE_FORMAT_B8G8R8A8_SRGB, \
PIPE_FORMAT_R8G8B8A8_SRGB, \
+ PIPE_FORMAT_B8G8R8A8_SRGB, \
PIPE_FORMAT_A8R8G8B8_SRGB, \
PIPE_FORMAT_A8B8G8R8_SRGB, \
0
@@ -1169,8 +1169,8 @@ static const struct format_mapping format_map[] = {
/* basic Alpha formats */
{
{ GL_ALPHA12, GL_ALPHA16, 0 },
- { PIPE_FORMAT_A16_UNORM, PIPE_FORMAT_A8_UNORM,
- DEFAULT_RGBA_FORMATS }
+ { PIPE_FORMAT_A16_UNORM, PIPE_FORMAT_R16G16B16A16_UNORM,
+ PIPE_FORMAT_A8_UNORM, DEFAULT_RGBA_FORMATS }
},
{
{ GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_COMPRESSED_ALPHA, 0 },
@@ -1180,7 +1180,8 @@ static const struct format_mapping format_map[] = {
/* basic Luminance formats */
{
{ GL_LUMINANCE12, GL_LUMINANCE16, 0 },
- { PIPE_FORMAT_L16_UNORM, PIPE_FORMAT_L8_UNORM, DEFAULT_RGB_FORMATS }
+ { PIPE_FORMAT_L16_UNORM, PIPE_FORMAT_R16G16B16A16_UNORM,
+ PIPE_FORMAT_L8_UNORM, DEFAULT_RGB_FORMATS }
},
{
{ 1, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, 0 },
@@ -1191,8 +1192,8 @@ static const struct format_mapping format_map[] = {
{
{ GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12,
GL_LUMINANCE16_ALPHA16, 0},
- { PIPE_FORMAT_L16A16_UNORM, PIPE_FORMAT_L8A8_UNORM,
- DEFAULT_RGBA_FORMATS }
+ { PIPE_FORMAT_L16A16_UNORM, PIPE_FORMAT_R16G16B16A16_UNORM,
+ PIPE_FORMAT_L8A8_UNORM, DEFAULT_RGBA_FORMATS }
},
{
{ 2, GL_LUMINANCE_ALPHA, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, 0 },
@@ -1207,7 +1208,8 @@ static const struct format_mapping format_map[] = {
/* basic Intensity formats */
{
{ GL_INTENSITY12, GL_INTENSITY16, 0 },
- { PIPE_FORMAT_I16_UNORM, PIPE_FORMAT_I8_UNORM, DEFAULT_RGBA_FORMATS }
+ { PIPE_FORMAT_I16_UNORM, PIPE_FORMAT_R16G16B16A16_UNORM,
+ PIPE_FORMAT_I8_UNORM, DEFAULT_RGBA_FORMATS }
},
{
{ GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8,