<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Nov 23, 2013 at 2:26 AM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If there is actually hardware support, it's okay to add those formats.<br>

See comments below.<br>
<div class="im"><br>
On Sat, Nov 23, 2013 at 3:59 AM, Mark Mueller <<a href="mailto:markkmueller@gmail.com">markkmueller@gmail.com</a>> wrote:<br>
> How about let's forget the whole concept of GPU loading for a moment as that<br>
> is only clouding the issue. As you said: "the mesa_* formats have one<br>
> purpose: to be used as OpenGL textures...." When I read the OGL spec for<br>
> glTexImage2D it lists GL_BGR as a format. Yet looking at mesa_* formats<br>
> there is only one BGR format represented: MESA_FORMAT_BGR888. There are 8<br>
> other valid OGL BGR textures that don't have MESA_FORMATs while all of the<br>
> RGBs ones _are_ all there? ie. these are the OGL BGR formats that are<br>
> missing:<br>
><br>
>    MESA_FORMAT_BGR_INT8,<br>
>    MESA_FORMAT_BGR_UINT8,<br>
>    MESA_FORMAT_BGR_INT16,<br>
>    MESA_FORMAT_BGR_UINT16,<br>
>    MESA_FORMAT_BGR_FLOAT16,<br>
>    MESA_FORMAT_BGR_INT32,<br>
>    MESA_FORMAT_BGR_UINT32,<br>
>    MESA_FORMAT_BGR_FLOAT32<br>
<br>
</div>Our hardware doesn't support these formats, because they are not<br>
aligned to a power-of-two number of components. If your hardware can<br>
do them, it's okay to add them.<br>
<div class="im"><br>
><br>
> There are also RGB, RGBA, and BGRA formats missing. Completeness seems like<br>
> justification enough for their inclusion:<br>
><br>
>    /* Red Green Blue */<br>
>    MESA_FORMAT_RGB233_REV,<br>
<br>
</div>Same as above. Also please don't use _REV, use BGR332 instead.<br></blockquote><div><br></div><div>Definitely better.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
>    MESA_FORMAT_RGB101111_REV,<br>
<br>
This format doesn't exist. I don't think you can specify it in glTexImage.<br></blockquote><div><br></div><div>The proposed new RGB ones are based on this statement in the spec:</div><div>"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."</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im"><br>
><br>
>    /* Red Green Blue Alpha */<br>
>    MESA_FORMAT_RGBA1010102,<br>
<br>
</div>This one might be useful.<br>
<br>
>    MESA_FORMAT_RGBA2101010_REV,<br>
<br>
I don't think you can have R with 2 bits.<br>
<br>
>    MESA_FORMAT_RGBA5999_REV,<br>
<br>
This format doesn't exist either.<br>
<br>
>    MESA_FORMAT_RGBA4444,<br>
>    MESA_FORMAT_RGBA4444_REV,<br>
<br>
These might be useful.<br>
<br>
>    MESA_FORMAT_RGBA1555_REV,<br>
<br>
I don't think you can have R with 1 bit.<br>
<div class="im"><br>
><br>
>    /* Blue Green Red Alpha */<br>
>    MESA_FORMAT_BGRA_INT8,<br>
>    MESA_FORMAT_BGRA_INT8_REV,<br>
>    MESA_FORMAT_BGRA_UINT8,<br>
>    MESA_FORMAT_BGRA_INT16,<br>
>    MESA_FORMAT_BGRA_UINT16,<br>
>    MESA_FORMAT_BGRA_FLOAT16,<br>
>    MESA_FORMAT_BGRA_INT32,<br>
>    MESA_FORMAT_BGRA_UINT32,<br>
>    MESA_FORMAT_BGRA_FLOAT32,<br>
>    MESA_FORMAT_BGRA4444,<br>
>    MESA_FORMAT_BGRA4444_REV,<br>
>    MESA_FORMAT_BGRA5551,<br>
<br>
</div>All these look good.<br>
<br>
>    MESA_FORMAT_BGRA1555_REV,<br>
<br>
I don't think you can have B with 1 bit.<br>
<br>
>    MESA_FORMAT_BGRA1010102,<br>
<br>
This one looks good.<br>
<br>
>    MESA_FORMAT_BGRA2101010_REV,<br>
<br>
I don't think you can have B with 2 bits.<br>
<br>
>    MESA_FORMAT_BGRA5999_REV,<br>
<br>
This one doesn't exist either and cannot be specified by TexImage.<br></blockquote><div><br></div><div>BGRAs and RGBAs were based on this from the spec:</div><div>"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."</div>
<div> </div></div><br></div></div>