From 27469aa72eb301e7c91f237719077372292e3704 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 27 Apr 2017 20:59:44 -0600 Subject: [PATCH] st/mesa: add more fallback gallium formats for GL integer formats MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/mesa/state_tracker/st_format.c | 50 +++++++++++++++--------------- 1 file 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 }, -- 2.30.2