aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-04-27 20:59:44 -0600
committerBrian Paul <[email protected]>2017-04-28 13:12:31 -0600
commit27469aa72eb301e7c91f237719077372292e3704 (patch)
tree1deca0e77b390c93d2b2c52857469ddcabe155f8 /src/mesa
parent6b60153f042c1191ae8fde3fbfc7d861650287aa (diff)
st/mesa: add more fallback gallium formats for GL integer formats
The VMware driver has a limited set of integer texture formats. We often have to fall back to 4-component formats when 1- or 2-component formats are missing. This fixes about 8 integer texture Piglit tests with the VMware driver on Linux. We've had this code in-house for a long time but I guess it was never up-streamed to Mesa master. This shouldn't regress any other drivers since we're either choosing an earlier format in the list, or failing anyway. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_format.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 7901d50b713..012f1a40151 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1186,7 +1186,7 @@ static const struct format_mapping format_map[] = {
},
{
{ 1, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, 0 },
- { PIPE_FORMAT_L8_UNORM, DEFAULT_RGB_FORMATS }
+ { PIPE_FORMAT_L8_UNORM, PIPE_FORMAT_L8A8_UNORM, DEFAULT_RGB_FORMATS }
},
/* basic Luminance/Alpha formats */
@@ -1682,101 +1682,101 @@ static const struct format_mapping format_map[] = {
{
{ GL_ALPHA_INTEGER_EXT,
GL_ALPHA8I_EXT, 0 },
- { PIPE_FORMAT_A8_SINT, 0 }
+ { PIPE_FORMAT_A8_SINT, PIPE_FORMAT_R8G8B8A8_SINT, 0 }
},
{
{ GL_ALPHA16I_EXT, 0 },
- { PIPE_FORMAT_A16_SINT, 0 }
+ { PIPE_FORMAT_A16_SINT, PIPE_FORMAT_R16G16B16A16_SINT, 0 }
},
{
{ GL_ALPHA32I_EXT, 0 },
- { PIPE_FORMAT_A32_SINT, 0 }
+ { PIPE_FORMAT_A32_SINT, PIPE_FORMAT_R32G32B32A32_SINT, 0 }
},
{
{ GL_ALPHA8UI_EXT, 0 },
- { PIPE_FORMAT_A8_UINT, 0 }
+ { PIPE_FORMAT_A8_UINT, PIPE_FORMAT_R8G8B8A8_UINT, 0 }
},
{
{ GL_ALPHA16UI_EXT, 0 },
- { PIPE_FORMAT_A16_UINT, 0 }
+ { PIPE_FORMAT_A16_UINT, PIPE_FORMAT_R16G16B16A16_UINT, 0 }
},
{
{ GL_ALPHA32UI_EXT, 0 },
- { PIPE_FORMAT_A32_UINT, 0 }
+ { PIPE_FORMAT_A32_UINT, PIPE_FORMAT_R32G32B32A32_UINT, 0 }
},
{
{ GL_INTENSITY8I_EXT, 0 },
- { PIPE_FORMAT_I8_SINT, 0 }
+ { PIPE_FORMAT_I8_SINT, PIPE_FORMAT_R8G8B8A8_SINT, 0 }
},
{
{ GL_INTENSITY16I_EXT, 0 },
- { PIPE_FORMAT_I16_SINT, 0 }
+ { PIPE_FORMAT_I16_SINT, PIPE_FORMAT_R16G16B16A16_SINT, 0 }
},
{
{ GL_INTENSITY32I_EXT, 0 },
- { PIPE_FORMAT_I32_SINT, 0 }
+ { PIPE_FORMAT_I32_SINT, PIPE_FORMAT_R32G32B32A32_SINT, 0 }
},
{
{ GL_INTENSITY8UI_EXT, 0 },
- { PIPE_FORMAT_I8_UINT, 0 }
+ { PIPE_FORMAT_I8_UINT, PIPE_FORMAT_R8G8B8A8_UINT, 0 }
},
{
{ GL_INTENSITY16UI_EXT, 0 },
- { PIPE_FORMAT_I16_UINT, 0 }
+ { PIPE_FORMAT_I16_UINT, PIPE_FORMAT_R16G16B16A16_UINT, 0 }
},
{
{ GL_INTENSITY32UI_EXT, 0 },
- { PIPE_FORMAT_I32_UINT, 0 }
+ { PIPE_FORMAT_I32_UINT, PIPE_FORMAT_R32G32B32A32_UINT, 0 }
},
{
{ GL_LUMINANCE8I_EXT, 0 },
- { PIPE_FORMAT_L8_SINT, 0 }
+ { PIPE_FORMAT_L8_SINT, PIPE_FORMAT_R8G8B8A8_SINT, 0 }
},
{
{ GL_LUMINANCE16I_EXT, 0 },
- { PIPE_FORMAT_L16_SINT, 0 }
+ { PIPE_FORMAT_L16_SINT, PIPE_FORMAT_R16G16B16A16_SINT, 0 }
},
{
{ GL_LUMINANCE32I_EXT, 0 },
- { PIPE_FORMAT_L32_SINT, 0 }
+ { PIPE_FORMAT_L32_SINT, PIPE_FORMAT_R32G32B32A32_SINT, 0 }
},
{
{ GL_LUMINANCE_INTEGER_EXT,
GL_LUMINANCE8UI_EXT, 0 },
- { PIPE_FORMAT_L8_UINT, 0 }
+ { PIPE_FORMAT_L8_UINT, PIPE_FORMAT_R8G8B8A8_UINT, 0 }
},
{
{ GL_LUMINANCE16UI_EXT, 0 },
- { PIPE_FORMAT_L16_UINT, 0 }
+ { PIPE_FORMAT_L16_UINT, PIPE_FORMAT_R16G16B16A16_UINT, 0 }
},
{
{ GL_LUMINANCE32UI_EXT, 0 },
- { PIPE_FORMAT_L32_UINT, 0 }
+ { PIPE_FORMAT_L32_UINT, PIPE_FORMAT_R32G32B32A32_UINT, 0 }
},
{
{ GL_LUMINANCE_ALPHA_INTEGER_EXT,
GL_LUMINANCE_ALPHA8I_EXT, 0 },
- { PIPE_FORMAT_L8A8_SINT, 0 }
+ { PIPE_FORMAT_L8A8_SINT, PIPE_FORMAT_R8G8B8A8_SINT, 0 }
},
{
{ GL_LUMINANCE_ALPHA16I_EXT, 0 },
- { PIPE_FORMAT_L16A16_SINT, 0 }
+ { PIPE_FORMAT_L16A16_SINT, PIPE_FORMAT_R16G16B16A16_SINT, 0 }
},
{
{ GL_LUMINANCE_ALPHA32I_EXT, 0 },
- { PIPE_FORMAT_L32A32_SINT, 0 }
+ { PIPE_FORMAT_L32A32_SINT, PIPE_FORMAT_R32G32B32A32_SINT, 0 }
},
{
{ GL_LUMINANCE_ALPHA8UI_EXT, 0 },
- { PIPE_FORMAT_L8A8_UINT, 0 }
+ { PIPE_FORMAT_L8A8_UINT, PIPE_FORMAT_R8G8B8A8_UINT, 0 }
},
{
{ GL_LUMINANCE_ALPHA16UI_EXT, 0 },
- { PIPE_FORMAT_L16A16_UINT, 0 }
+ { PIPE_FORMAT_L16A16_UINT, PIPE_FORMAT_R16G16B16A16_UINT, 0 }
},
{
{ GL_LUMINANCE_ALPHA32UI_EXT, 0 },
- { PIPE_FORMAT_L32A32_UINT, 0 }
+ { PIPE_FORMAT_L32A32_UINT, PIPE_FORMAT_R32G32B32A32_UINT, 0 }
},
{
{ GL_RGB16I_EXT, 0 },