[Mesa-dev] [PATCH 1/2] mesa: Add gl_formats to cover all GLUser provided format/type combinations
Marek Olšák
maraeo at gmail.com
Sat Nov 23 02:26:13 PST 2013
If there is actually hardware support, it's okay to add those formats.
See comments below.
On Sat, Nov 23, 2013 at 3:59 AM, Mark Mueller <markkmueller at gmail.com> wrote:
> How about let's forget the whole concept of GPU loading for a moment as that
> is only clouding the issue. As you said: "the mesa_* formats have one
> purpose: to be used as OpenGL textures...." When I read the OGL spec for
> glTexImage2D it lists GL_BGR as a format. Yet looking at mesa_* formats
> there is only one BGR format represented: MESA_FORMAT_BGR888. There are 8
> other valid OGL BGR textures that don't have MESA_FORMATs while all of the
> RGBs ones _are_ all there? ie. these are the OGL BGR formats that are
> missing:
>
> MESA_FORMAT_BGR_INT8,
> MESA_FORMAT_BGR_UINT8,
> MESA_FORMAT_BGR_INT16,
> MESA_FORMAT_BGR_UINT16,
> MESA_FORMAT_BGR_FLOAT16,
> MESA_FORMAT_BGR_INT32,
> MESA_FORMAT_BGR_UINT32,
> MESA_FORMAT_BGR_FLOAT32
Our hardware doesn't support these formats, because they are not
aligned to a power-of-two number of components. If your hardware can
do them, it's okay to add them.
>
> There are also RGB, RGBA, and BGRA formats missing. Completeness seems like
> justification enough for their inclusion:
>
> /* Red Green Blue */
> MESA_FORMAT_RGB233_REV,
Same as above. Also please don't use _REV, use BGR332 instead.
> MESA_FORMAT_RGB101111_REV,
This format doesn't exist. I don't think you can specify it in glTexImage.
>
> /* Red Green Blue Alpha */
> MESA_FORMAT_RGBA1010102,
This one might be useful.
> MESA_FORMAT_RGBA2101010_REV,
I don't think you can have R with 2 bits.
> MESA_FORMAT_RGBA5999_REV,
This format doesn't exist either.
> MESA_FORMAT_RGBA4444,
> MESA_FORMAT_RGBA4444_REV,
These might be useful.
> MESA_FORMAT_RGBA1555_REV,
I don't think you can have R with 1 bit.
>
> /* Blue Green Red Alpha */
> MESA_FORMAT_BGRA_INT8,
> MESA_FORMAT_BGRA_INT8_REV,
> MESA_FORMAT_BGRA_UINT8,
> MESA_FORMAT_BGRA_INT16,
> MESA_FORMAT_BGRA_UINT16,
> MESA_FORMAT_BGRA_FLOAT16,
> MESA_FORMAT_BGRA_INT32,
> MESA_FORMAT_BGRA_UINT32,
> MESA_FORMAT_BGRA_FLOAT32,
> MESA_FORMAT_BGRA4444,
> MESA_FORMAT_BGRA4444_REV,
> MESA_FORMAT_BGRA5551,
All these look good.
> MESA_FORMAT_BGRA1555_REV,
I don't think you can have B with 1 bit.
> MESA_FORMAT_BGRA1010102,
This one looks good.
> MESA_FORMAT_BGRA2101010_REV,
I don't think you can have B with 2 bits.
> MESA_FORMAT_BGRA5999_REV,
This one doesn't exist either and cannot be specified by TexImage.
Marek
More information about the mesa-dev
mailing list