[Mesa-dev] [PATCH] st/mesa: add more fallback gallium formats for GL integer formats
Marek Olšák
maraeo at gmail.com
Fri Apr 28 18:37:49 UTC 2017
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Fri, Apr 28, 2017 at 5:11 AM, Brian Paul <brianp at vmware.com> wrote:
> 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.
> ---
> 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 7901d50..012f1a4 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 },
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list