[Mesa-dev] [PATCH 1/2] mesa: Add gl_formats to cover all GLUser provided format/type combinations
Mark Mueller
markkmueller at gmail.com
Sat Nov 23 13:23:58 PST 2013
On Sat, Nov 23, 2013 at 2:26 AM, Marek Olšák <maraeo at gmail.com> wrote:
> 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.
>
Definitely better.
>
> > MESA_FORMAT_RGB101111_REV,
>
> This format doesn't exist. I don't think you can specify it in glTexImage.
>
The proposed new RGB ones are based on this statement in the spec:
"GL_INVALID_OPERATION is generated if type is one of
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, or
GL_UNSIGNED_INT_10F_11F_11F_REV, and format is not GL_RGB."
>
> >
> > /* 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.
>
BGRAs and RGBAs were based on this from the spec:
"GL_INVALID_OPERATION is generated if type is one of
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,
GL_UNSIGNED_INT_10_10_10_2, GL_UNSIGNED_INT_2_10_10_10_REV, or
GL_UNSIGNED_INT_5_9_9_9_REV, and format is neither GL_RGBA nor GL_BGRA."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131123/9edaedb6/attachment-0001.html>
More information about the mesa-dev
mailing list