[Mesa-dev] [PATCH 1/2] mesa: Add gl_formats to cover all GLUser provided format/type combinations

Mark Mueller markkmueller at gmail.com
Fri Nov 15 12:00:30 PST 2013


On Fri, Nov 15, 2013 at 4:58 AM, Roland Scheidegger <sroland at vmware.com>wrote:

> On 11/14/2013 11:53 PM, Mark Mueller wrote:
>
>> This and the subsequent patch are the first steps in adding support to
>> load textures
>> via GPU instead of CPU. This patch expands Mesa's gl_formats such that
>> all GLUser
>> format/type combinations are represented and thus can be communicated to
>> lower levels
>> within dri drivers. The new formats are source only thus they require no
>> associated
>> Texstore functions or render targets, therefore they are added
>> _privately_ at the end
>> of the gl_formats list.
>>
>
> Do you really need 32bit normalized formats? I thought usually hw can't
> really deal with them anyway (because essentially you can't convert to
> floats without losing precision).
>

I've gone back and forth on this. Ultimately I settled on the current setup
because it followed how Mesa and dri drivers already handle other similar
existing formats. The intent is to let the dri driver decide what the
hardware can and can't deal with, the first step being communicating to the
driver what format the GLUser has provided via a known mechanism. By the
same logic, it's the driver's decision as to what format the texture takes
when it gets to it's final resting place in video ram, thus the
gl_format_info.DataType field isn't really relevant here.


Some other minor nits inline, can't say if the approach in general makes
> sense (might make more sense to support these formats fully?).


>From my recent assessment, adding more formats with full support would
offer more opportunities to picki target formats that require less CPU
processing of the GLUser texture. My intent is to use the GPU for this,
thus I'm not concerned for fully supporting the new cases by adding
Texstore functions and render target info.



>
>
>
>
>  Signed-off-by: Mark Mueller <MarkKMueller at gmail.com>
>> ---
>>   src/mesa/main/formats.c   | 441 ++++++++++++++++++++++++++++++
>> +++++++++++++++-
>>   src/mesa/main/formats.h   |  70 +++++++-
>>   src/mesa/main/texformat.c | 271 ++++++++++++++++++++++++++++
>>   src/mesa/main/texformat.h |  11 ++
>>   4 files changed, 789 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
>> index 07d2a72..2c32bba 100644
>> --- a/src/mesa/main/formats.c
>> +++ b/src/mesa/main/formats.c
>> @@ -76,7 +76,7 @@ struct gl_format_info
>>    * These must be in the same order as the MESA_FORMAT_* enums so that
>>    * we can do lookups without searching.
>>    */
>> -static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
>> +static struct gl_format_info format_info[MESA_PRIVATE_FORMAT_COUNT] =
>>   {
>>      {
>>         MESA_FORMAT_NONE,            /* Name */
>> @@ -1572,7 +1572,7 @@ static struct gl_format_info
>> format_info[MESA_FORMAT_COUNT] =
>>      },
>>      {
>>         MESA_FORMAT_RGB9_E5_FLOAT,
>> -      "MESA_FORMAT_RGB9_E5",
>> +      "MESA_FORMAT_RGB9_E5_FLOAT",
>>         GL_RGB,
>>         GL_FLOAT,
>>         9, 9, 9, 0,
>> @@ -1763,6 +1763,440 @@ static struct gl_format_info
>> format_info[MESA_FORMAT_COUNT] =
>>         0, 0, 0, 0, 0,
>>         1, 1, 16
>>      },
>> +
>> +   /*
>> +    * Formats to exactly represent format/type combinations for OGLUser
>> provided
>> +    * textures. These formats are required only for caching of an
>> unaltered copy of
>> +    * the application texture prior to passing them to the GPU, where
>> they are
>> +    * processed to the final internalFormat and miptree location.
>> Texstore functions
>> +    * do not apply and these are not intended to be used as render
>> targets.
>> +    * Listing is based on the order presented in the glTexImage2D spec.
>> +    */
>> +   /* Red Solo - !cup */
>> +   {
>> +      MESA_FORMAT_R32,
>> +      "MESA_FORMAT_R32",
>> +      GL_RED,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      16, 0, 0, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 2
>>
> Should probably 32bits (and 4 bytes) if it's named R32.
>
>
Definitely should. Thanks.


>
>  +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_R32,
>> +      "MESA_FORMAT_SIGNED_R32",
>> +      GL_RED,
>> +      GL_SIGNED_NORMALIZED,
>> +      32, 0, 0, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +
>> +   /* Red Green - !show */
>> +   {
>> +      MESA_FORMAT_SIGNED_RG88,
>> +      "MESA_FORMAT_SIGNED_RG88",
>> +      GL_RG,
>> +      GL_SIGNED_NORMALIZED,
>> +      8, 8, 0, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 2
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_RG1616,
>> +      "MESA_FORMAT_SIGNED_RG1616",
>> +      GL_RG,
>> +      GL_SIGNED_NORMALIZED,
>> +      16, 16, 0, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_RG3232,
>> +      "MESA_FORMAT_RG3232",
>> +      GL_RG,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      32, 32, 0, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_RG3232,
>> +      "MESA_FORMAT_SIGNED_RG3232",
>> +      GL_RG,
>> +      GL_SIGNED_NORMALIZED,
>> +      32, 32, 0, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +
>> +   /* Red Green Blue */
>> +   {
>> +      MESA_FORMAT_SIGNED_RGB888,
>> +      "MESA_FORMAT_SIGNED_RGB888",
>> +      GL_RGB,
>> +      GL_SIGNED_NORMALIZED,
>> +      8, 8, 8, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 3
>> +   },
>> +   {
>> +      MESA_FORMAT_RGB161616,
>> +      "MESA_FORMAT_RG161616",
>> +      GL_RGB,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      16, 16, 16, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 6
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_RGB161616,
>> +      "MESA_FORMAT_SIGNED_RGB161616",
>> +      GL_RGB,
>> +      GL_SIGNED_NORMALIZED,
>> +      16, 16, 16, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 6
>> +   },
>> +   {
>> +      MESA_FORMAT_RGB323232,
>> +      "MESA_FORMAT_RGB323232",
>> +      GL_RGB,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      32, 32, 32, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 12
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_RGB323232,
>> +      "MESA_FORMAT_SIGNED_RGB323232",
>> +      GL_RGB,
>> +      GL_SIGNED_NORMALIZED,
>> +      32, 32, 32, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 12
>> +   },
>> +   {
>> +      MESA_FORMAT_RGB233_REV,
>> +      "MESA_FORMAT_RGB233_REV",
>> +      GL_RGB,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      3, 3, 2, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 1
>> +   },
>> +   {
>> +      MESA_FORMAT_RGB101111_REV,
>> +      "MESA_FORMAT_RGB101111_REV",
>> +      GL_RGB,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      11, 11, 10, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +
>> +   /* Blue Green Red */
>> +   {
>> +       MESA_FORMAT_SIGNED_BGR888,
>> +       "MESA_FORMAT_SIGNED_BGR888",
>> +       GL_RGB,
>> +       GL_SIGNED_NORMALIZED,
>> +       8, 8, 8, 0,
>> +       0, 0, 0, 0, 0,
>> +       1, 1, 3
>> +   },
>> +   {
>> +      MESA_FORMAT_BGR161616,
>> +      "MESA_FORMAT_BGR161616",
>> +      GL_RGB,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      16, 16, 16, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 6
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_BGR161616,
>> +      "MESA_FORMAT_SIGNED_BGR161616",
>> +      GL_RGB,
>> +      GL_SIGNED_NORMALIZED,
>> +      16, 16, 16, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 6
>> +   },
>> +   {
>> +      MESA_FORMAT_BGR_FLOAT16,
>> +      "MESA_FORMAT_BGR_FLOAT16",
>> +      GL_RGB,
>> +      GL_FLOAT,
>> +      16, 16, 16, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 6
>> +   },
>> +   {
>> +      MESA_FORMAT_BGR323232,
>> +      "MESA_FORMAT_BGR323232",
>> +      GL_RGB,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      32, 32, 32, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 12
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_BGR323232,
>> +      "MESA_FORMAT_SIGNED_BGR323232",
>> +      GL_RGB,
>> +      GL_SIGNED_NORMALIZED,
>> +      32, 32, 32, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 12
>> +   },
>> +   {
>> +      MESA_FORMAT_BGR_FLOAT32,
>> +      "MESA_FORMAT_BGR_FLOAT32",
>> +      GL_RGB,
>> +      GL_FLOAT,
>> +      32, 32, 32, 0,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 12
>> +   },
>> +
>> +   /* Red Green Blue Alpha */
>> +   {
>> +      MESA_FORMAT_RGBA16161616,
>> +      "MESA_FORMAT_RGBA161616",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      16, 16, 16, 16,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_RGBA16161616,
>> +      "MESA_FORMAT_SIGNED_RGBA161616",
>> +      GL_RGBA,
>> +      GL_SIGNED_NORMALIZED,
>> +      16, 16, 16, 16,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA32323232,
>> +      "MESA_FORMAT_RGBA323232",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      32, 32, 32, 32,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 16
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_RGBA32323232,
>> +      "MESA_FORMAT_SIGNED_RGBA323232",
>> +      GL_RGBA,
>> +      GL_SIGNED_NORMALIZED,
>> +      32, 32, 32, 32,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 16
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA1010102,
>> +      "MESA_FORMAT_RGBA1010102",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      10, 10, 10, 2,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA2101010_REV,
>> +      "MESA_FORMAT_RGBA2101010_REV",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      10, 10, 10, 2,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA5999_REV,
>> +      "MESA_FORMAT_RGBA5999_REV",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      9, 9, 9, 5,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA4444,        /* Name */
>> +      "MESA_FORMAT_RGBA4444",      /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      4, 4, 4, 4,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA4444_REV,    /* Name */
>> +      "MESA_FORMAT_RGBA4444_REV",  /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      4, 4, 4, 4,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_RGBA1555_REV,    /* Name */
>> +      "MESA_FORMAT_RGBA1555_REV",  /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      5, 5, 5, 1,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +
>> +   /* Blue Green Red Alpha */
>> +   {
>> +      MESA_FORMAT_BGRA8888,        /* Name */
>> +      "MESA_FORMAT_BGRA8888",      /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      8, 8, 8, 8,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 4                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA8888_REV,    /* Name */
>> +      "MESA_FORMAT_BGRA8888",      /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      8, 8, 8, 8,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 4                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_BGRA8888,
>> +      "MESA_FORMAT_SIGNED_BGRA8888",
>> +      GL_RGBA,
>> +      GL_SIGNED_NORMALIZED,
>> +      8, 8, 8, 8,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA16161616,
>> +      "MESA_FORMAT_BGRA16161616",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      16, 16, 16, 16,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_BGRA16161616,
>> +      "MESA_FORMAT_SIGNED_BGRA16161616",
>> +      GL_RGBA,
>> +      GL_SIGNED_NORMALIZED,
>> +      16, 16, 16, 16,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA_FLOAT16,
>> +      "MESA_FORMAT_BGRA_FLOAT16",
>> +      GL_RGBA,
>> +      GL_FLOAT,
>> +      16, 16, 16, 16,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 8
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA32323232,
>> +      "MESA_FORMAT_BGRA32323232",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      32, 32, 32, 32,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 16
>> +   },
>> +   {
>> +      MESA_FORMAT_SIGNED_BGRA32323232,
>> +      "MESA_FORMAT_SIGNED_BGRA32323232",
>> +      GL_RGBA,
>> +      GL_SIGNED_NORMALIZED,
>> +      32, 32, 32, 32,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 16
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA_FLOAT32,
>> +      "MESA_FORMAT_BGRA_FLOAT32",
>> +      GL_RGBA,
>> +      GL_FLOAT,
>> +      32, 32, 32, 32,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 16
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA4444,        /* Name */
>> +      "MESA_FORMAT_BGRA4444",      /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      4, 4, 4, 4,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA4444_REV,    /* Name */
>> +      "MESA_FORMAT_BGRA4444_REV",  /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      4, 4, 4, 4,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA5551,        /* Name */
>> +      "MESA_FORMAT_BGRA5551",      /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      5, 5, 5, 1,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA1555_REV,    /* Name */
>> +      "MESA_FORMAT_BGRA1555_REV",  /* StrName */
>> +      GL_RGBA,                     /* BaseFormat */
>> +      GL_UNSIGNED_NORMALIZED,      /* DataType */
>> +      5, 5, 5, 1,                  /* Red/Green/Blue/AlphaBits */
>> +      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
>> +      1, 1, 2                      /* BlockWidth/Height,Bytes */
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA1010102,
>> +      "MESA_FORMAT_BGRA1010102",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      10, 10, 10, 2,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA2101010_REV,
>> +      "MESA_FORMAT_BGRA2101010_REV",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      10, 10, 10, 2,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>> +   {
>> +      MESA_FORMAT_BGRA5999_REV,
>> +      "MESA_FORMAT_BGRA5999_REV",
>> +      GL_RGBA,
>> +      GL_UNSIGNED_NORMALIZED,
>> +      9, 9, 9, 5,
>> +      0, 0, 0, 0, 0,
>> +      1, 1, 4
>> +   },
>>   };
>>
>>
>> @@ -2221,7 +2655,7 @@ _mesa_test_formats(void)
>>   {
>>      GLuint i;
>>
>> -   STATIC_ASSERT(Elements(format_info) == MESA_FORMAT_COUNT);
>> +   STATIC_ASSERT(Elements(format_info) == MESA_PRIVATE_FORMAT_COUNT);
>>
>>      for (i = 0; i < MESA_FORMAT_COUNT; i++) {
>>         const struct gl_format_info *info = _mesa_get_format_info(i);
>> @@ -3361,6 +3795,7 @@ _mesa_format_matches_format_and_type(gl_format
>> gl_format,
>>      case MESA_FORMAT_XBGR32323232_FLOAT:
>>      case MESA_FORMAT_XBGR32323232_UINT:
>>      case MESA_FORMAT_XBGR32323232_SINT:
>> +   default:
>>         return GL_FALSE;
>>      }
>>
>> diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
>> index 64b4b9a..687b525 100644
>> --- a/src/mesa/main/formats.h
>> +++ b/src/mesa/main/formats.h
>> @@ -304,7 +304,75 @@ typedef enum
>>      MESA_FORMAT_XBGR32323232_UINT, /* ... */
>>      MESA_FORMAT_XBGR32323232_SINT, /* ... */
>>
>> -   MESA_FORMAT_COUNT
>> +   MESA_FORMAT_COUNT,
>> +
>> +   /*
>> +    * Formats to exactly represent format/type combinations for OGLUser
>> provided
>> +    * textures. These formats are required only for caching of an
>> unaltered copy of
>> +    * the application texture prior to passing them to the GPU, where
>> they are
>> +    * processed to the final internalFormat and miptree location.
>> Texstore functions
>> +    * do not apply and these are not intended to be used as render
>> targets.
>> +    * Listing is based on the order presented in the glTexImage2D spec.
>> +    */
>> +   /* Red Solo - !cup */
>> +   MESA_FORMAT_R32 = MESA_FORMAT_COUNT,
>> +   MESA_FORMAT_SIGNED_R32,
>> +
>> +   /* Red Green - !show */
>> +   MESA_FORMAT_SIGNED_RG88,
>> +   MESA_FORMAT_SIGNED_RG1616,
>> +   MESA_FORMAT_RG3232,
>> +   MESA_FORMAT_SIGNED_RG3232,
>> +
>> +   /* Red Green Blue */
>> +   MESA_FORMAT_SIGNED_RGB888,
>> +   MESA_FORMAT_RGB161616,
>> +   MESA_FORMAT_SIGNED_RGB161616,
>> +   MESA_FORMAT_RGB323232,
>> +   MESA_FORMAT_SIGNED_RGB323232,
>> +   MESA_FORMAT_RGB233_REV,
>> +   MESA_FORMAT_RGB101111_REV,
>> +
>> +   /* Blue Green Red */
>> +   MESA_FORMAT_SIGNED_BGR888,
>> +   MESA_FORMAT_BGR161616,
>> +   MESA_FORMAT_SIGNED_BGR161616,
>> +   MESA_FORMAT_BGR_FLOAT16,
>> +   MESA_FORMAT_BGR323232,
>> +   MESA_FORMAT_SIGNED_BGR323232,
>> +   MESA_FORMAT_BGR_FLOAT32,
>> +
>> +   /* Red Green Blue Alpha */
>> +   MESA_FORMAT_RGBA16161616,
>> +   MESA_FORMAT_SIGNED_RGBA16161616,
>> +   MESA_FORMAT_RGBA32323232,
>> +   MESA_FORMAT_SIGNED_RGBA32323232,
>> +   MESA_FORMAT_RGBA1010102,
>> +   MESA_FORMAT_RGBA2101010_REV,
>> +   MESA_FORMAT_RGBA5999_REV,
>> +   MESA_FORMAT_RGBA4444,
>> +   MESA_FORMAT_RGBA4444_REV,
>> +   MESA_FORMAT_RGBA1555_REV,
>> +
>> +   /* Blue Green Red Alpha */
>> +   MESA_FORMAT_BGRA8888,
>> +   MESA_FORMAT_BGRA8888_REV,
>> +   MESA_FORMAT_SIGNED_BGRA8888,
>> +   MESA_FORMAT_BGRA16161616,
>> +   MESA_FORMAT_SIGNED_BGRA16161616,
>> +   MESA_FORMAT_BGRA_FLOAT16,
>> +   MESA_FORMAT_BGRA32323232,
>> +   MESA_FORMAT_SIGNED_BGRA32323232,
>> +   MESA_FORMAT_BGRA_FLOAT32,
>> +   MESA_FORMAT_BGRA4444,
>> +   MESA_FORMAT_BGRA4444_REV,
>> +   MESA_FORMAT_BGRA5551,
>> +   MESA_FORMAT_BGRA1555_REV,
>> +   MESA_FORMAT_BGRA1010102,
>> +   MESA_FORMAT_BGRA2101010_REV,
>> +   MESA_FORMAT_BGRA5999_REV,
>> +
>> +   MESA_PRIVATE_FORMAT_COUNT
>>   } gl_format;
>>
>>
>> diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
>> index d3aa477..713fdf2 100644
>> --- a/src/mesa/main/texformat.c
>> +++ b/src/mesa/main/texformat.c
>> @@ -831,3 +831,274 @@ _mesa_tex_target_is_array(GLenum target)
>>         return GL_FALSE;
>>      }
>>   }
>> +
>> +/**
>> + * Choose a texture format that exaclty matches the application texture
>>
> exactly.
>
>
got-it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131115/cd5a894a/attachment-0001.html>


More information about the mesa-dev mailing list