<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 4:58 AM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.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"><div>On 11/14/2013 11:53 PM, Mark Mueller 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">
This and the subsequent patch are the first steps in adding support to load textures<br>
via GPU instead of CPU. This patch expands Mesa's gl_formats such that all GLUser<br>
format/type combinations are represented and thus can be communicated to lower levels<br>
within dri drivers. The new formats are source only thus they require no associated<br>
Texstore functions or render targets, therefore they are added _privately_ at the end<br>
of the gl_formats list.<br>
</blockquote>
<br></div>
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).<br></blockquote><div><br></div><div>
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.</div>
<div><br></div><div><br></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">
Some other minor nits inline, can't say if the approach in general makes sense (might make more sense to support these formats fully?).</blockquote><div><br></div><div>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.</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><div><br>
<br>
<br>
<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">
Signed-off-by: Mark Mueller <<a href="mailto:MarkKMueller@gmail.com" target="_blank">MarkKMueller@gmail.com</a>><br>
---<br>
src/mesa/main/formats.c | 441 ++++++++++++++++++++++++++++++<u></u>+++++++++++++++-<br>
src/mesa/main/formats.h | 70 +++++++-<br>
src/mesa/main/texformat.c | 271 ++++++++++++++++++++++++++++<br>
src/mesa/main/texformat.h | 11 ++<br>
4 files changed, 789 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c<br>
index 07d2a72..2c32bba 100644<br>
--- a/src/mesa/main/formats.c<br>
+++ b/src/mesa/main/formats.c<br>
@@ -76,7 +76,7 @@ struct gl_format_info<br>
* These must be in the same order as the MESA_FORMAT_* enums so that<br>
* we can do lookups without searching.<br>
*/<br>
-static struct gl_format_info format_info[MESA_FORMAT_COUNT] =<br>
+static struct gl_format_info format_info[MESA_PRIVATE_<u></u>FORMAT_COUNT] =<br>
{<br>
{<br>
MESA_FORMAT_NONE, /* Name */<br>
@@ -1572,7 +1572,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =<br>
},<br>
{<br>
MESA_FORMAT_RGB9_E5_FLOAT,<br>
- "MESA_FORMAT_RGB9_E5",<br>
+ "MESA_FORMAT_RGB9_E5_FLOAT",<br>
GL_RGB,<br>
GL_FLOAT,<br>
9, 9, 9, 0,<br>
@@ -1763,6 +1763,440 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =<br>
0, 0, 0, 0, 0,<br>
1, 1, 16<br>
},<br>
+<br>
+ /*<br>
+ * Formats to exactly represent format/type combinations for OGLUser provided<br>
+ * textures. These formats are required only for caching of an unaltered copy of<br>
+ * the application texture prior to passing them to the GPU, where they are<br>
+ * processed to the final internalFormat and miptree location. Texstore functions<br>
+ * do not apply and these are not intended to be used as render targets.<br>
+ * Listing is based on the order presented in the glTexImage2D spec.<br>
+ */<br>
+ /* Red Solo - !cup */<br>
+ {<br>
+ MESA_FORMAT_R32,<br>
+ "MESA_FORMAT_R32",<br>
+ GL_RED,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 16, 0, 0, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 2<br>
</blockquote></div></div>
Should probably 32bits (and 4 bytes) if it's named R32.<div><div><br></div></div></blockquote><div><br></div><div>Definitely should. Thanks.</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><div>
<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">
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_R32,<br>
+ "MESA_FORMAT_SIGNED_R32",<br>
+ GL_RED,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 32, 0, 0, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+<br>
+ /* Red Green - !show */<br>
+ {<br>
+ MESA_FORMAT_SIGNED_RG88,<br>
+ "MESA_FORMAT_SIGNED_RG88",<br>
+ GL_RG,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 8, 8, 0, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 2<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_RG1616,<br>
+ "MESA_FORMAT_SIGNED_RG1616",<br>
+ GL_RG,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 16, 16, 0, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RG3232,<br>
+ "MESA_FORMAT_RG3232",<br>
+ GL_RG,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 32, 32, 0, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_RG3232,<br>
+ "MESA_FORMAT_SIGNED_RG3232",<br>
+ GL_RG,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 32, 32, 0, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+<br>
+ /* Red Green Blue */<br>
+ {<br>
+ MESA_FORMAT_SIGNED_RGB888,<br>
+ "MESA_FORMAT_SIGNED_RGB888",<br>
+ GL_RGB,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 8, 8, 8, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 3<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGB161616,<br>
+ "MESA_FORMAT_RG161616",<br>
+ GL_RGB,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 16, 16, 16, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 6<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_RGB161616,<br>
+ "MESA_FORMAT_SIGNED_RGB161616"<u></u>,<br>
+ GL_RGB,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 16, 16, 16, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 6<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGB323232,<br>
+ "MESA_FORMAT_RGB323232",<br>
+ GL_RGB,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 32, 32, 32, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 12<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_RGB323232,<br>
+ "MESA_FORMAT_SIGNED_RGB323232"<u></u>,<br>
+ GL_RGB,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 32, 32, 32, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 12<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGB233_REV,<br>
+ "MESA_FORMAT_RGB233_REV",<br>
+ GL_RGB,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 3, 3, 2, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 1<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGB101111_REV,<br>
+ "MESA_FORMAT_RGB101111_REV",<br>
+ GL_RGB,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 11, 11, 10, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+<br>
+ /* Blue Green Red */<br>
+ {<br>
+ MESA_FORMAT_SIGNED_BGR888,<br>
+ "MESA_FORMAT_SIGNED_BGR888",<br>
+ GL_RGB,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 8, 8, 8, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 3<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGR161616,<br>
+ "MESA_FORMAT_BGR161616",<br>
+ GL_RGB,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 16, 16, 16, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 6<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_BGR161616,<br>
+ "MESA_FORMAT_SIGNED_BGR161616"<u></u>,<br>
+ GL_RGB,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 16, 16, 16, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 6<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGR_FLOAT16,<br>
+ "MESA_FORMAT_BGR_FLOAT16",<br>
+ GL_RGB,<br>
+ GL_FLOAT,<br>
+ 16, 16, 16, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 6<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGR323232,<br>
+ "MESA_FORMAT_BGR323232",<br>
+ GL_RGB,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 32, 32, 32, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 12<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_BGR323232,<br>
+ "MESA_FORMAT_SIGNED_BGR323232"<u></u>,<br>
+ GL_RGB,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 32, 32, 32, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 12<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGR_FLOAT32,<br>
+ "MESA_FORMAT_BGR_FLOAT32",<br>
+ GL_RGB,<br>
+ GL_FLOAT,<br>
+ 32, 32, 32, 0,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 12<br>
+ },<br>
+<br>
+ /* Red Green Blue Alpha */<br>
+ {<br>
+ MESA_FORMAT_RGBA16161616,<br>
+ "MESA_FORMAT_RGBA161616",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 16, 16, 16, 16,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_<u></u>RGBA16161616,<br>
+ "MESA_FORMAT_SIGNED_<u></u>RGBA161616",<br>
+ GL_RGBA,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 16, 16, 16, 16,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA32323232,<br>
+ "MESA_FORMAT_RGBA323232",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 32, 32, 32, 32,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 16<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_<u></u>RGBA32323232,<br>
+ "MESA_FORMAT_SIGNED_<u></u>RGBA323232",<br>
+ GL_RGBA,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 32, 32, 32, 32,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 16<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA1010102,<br>
+ "MESA_FORMAT_RGBA1010102",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 10, 10, 10, 2,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA2101010_REV,<br>
+ "MESA_FORMAT_RGBA2101010_REV",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 10, 10, 10, 2,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA5999_REV,<br>
+ "MESA_FORMAT_RGBA5999_REV",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 9, 9, 9, 5,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA4444, /* Name */<br>
+ "MESA_FORMAT_RGBA4444", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA4444_REV, /* Name */<br>
+ "MESA_FORMAT_RGBA4444_REV", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_RGBA1555_REV, /* Name */<br>
+ "MESA_FORMAT_RGBA1555_REV", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+<br>
+ /* Blue Green Red Alpha */<br>
+ {<br>
+ MESA_FORMAT_BGRA8888, /* Name */<br>
+ "MESA_FORMAT_BGRA8888", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 4 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA8888_REV, /* Name */<br>
+ "MESA_FORMAT_BGRA8888", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 4 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_BGRA8888,<br>
+ "MESA_FORMAT_SIGNED_BGRA8888",<br>
+ GL_RGBA,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 8, 8, 8, 8,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA16161616,<br>
+ "MESA_FORMAT_BGRA16161616",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 16, 16, 16, 16,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_<u></u>BGRA16161616,<br>
+ "MESA_FORMAT_SIGNED_<u></u>BGRA16161616",<br>
+ GL_RGBA,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 16, 16, 16, 16,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA_FLOAT16,<br>
+ "MESA_FORMAT_BGRA_FLOAT16",<br>
+ GL_RGBA,<br>
+ GL_FLOAT,<br>
+ 16, 16, 16, 16,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 8<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA32323232,<br>
+ "MESA_FORMAT_BGRA32323232",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 32, 32, 32, 32,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 16<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_SIGNED_<u></u>BGRA32323232,<br>
+ "MESA_FORMAT_SIGNED_<u></u>BGRA32323232",<br>
+ GL_RGBA,<br>
+ GL_SIGNED_NORMALIZED,<br>
+ 32, 32, 32, 32,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 16<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA_FLOAT32,<br>
+ "MESA_FORMAT_BGRA_FLOAT32",<br>
+ GL_RGBA,<br>
+ GL_FLOAT,<br>
+ 32, 32, 32, 32,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 16<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA4444, /* Name */<br>
+ "MESA_FORMAT_BGRA4444", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA4444_REV, /* Name */<br>
+ "MESA_FORMAT_BGRA4444_REV", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA5551, /* Name */<br>
+ "MESA_FORMAT_BGRA5551", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA1555_REV, /* Name */<br>
+ "MESA_FORMAT_BGRA1555_REV", /* StrName */<br>
+ GL_RGBA, /* BaseFormat */<br>
+ GL_UNSIGNED_NORMALIZED, /* DataType */<br>
+ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */<br>
+ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/<u></u>StencilBits */<br>
+ 1, 1, 2 /* BlockWidth/Height,Bytes */<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA1010102,<br>
+ "MESA_FORMAT_BGRA1010102",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 10, 10, 10, 2,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA2101010_REV,<br>
+ "MESA_FORMAT_BGRA2101010_REV",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 10, 10, 10, 2,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
+ {<br>
+ MESA_FORMAT_BGRA5999_REV,<br>
+ "MESA_FORMAT_BGRA5999_REV",<br>
+ GL_RGBA,<br>
+ GL_UNSIGNED_NORMALIZED,<br>
+ 9, 9, 9, 5,<br>
+ 0, 0, 0, 0, 0,<br>
+ 1, 1, 4<br>
+ },<br>
};<br>
<br>
<br>
@@ -2221,7 +2655,7 @@ _mesa_test_formats(void)<br>
{<br>
GLuint i;<br>
<br>
- STATIC_ASSERT(Elements(format_<u></u>info) == MESA_FORMAT_COUNT);<br>
+ STATIC_ASSERT(Elements(format_<u></u>info) == MESA_PRIVATE_FORMAT_COUNT);<br>
<br>
for (i = 0; i < MESA_FORMAT_COUNT; i++) {<br>
const struct gl_format_info *info = _mesa_get_format_info(i);<br>
@@ -3361,6 +3795,7 @@ _mesa_format_matches_format_<u></u>and_type(gl_format gl_format,<br>
case MESA_FORMAT_XBGR32323232_<u></u>FLOAT:<br>
case MESA_FORMAT_XBGR32323232_UINT:<br>
case MESA_FORMAT_XBGR32323232_SINT:<br>
+ default:<br>
return GL_FALSE;<br>
}<br>
<br>
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h<br>
index 64b4b9a..687b525 100644<br>
--- a/src/mesa/main/formats.h<br>
+++ b/src/mesa/main/formats.h<br>
@@ -304,7 +304,75 @@ typedef enum<br>
MESA_FORMAT_XBGR32323232_UINT, /* ... */<br>
MESA_FORMAT_XBGR32323232_SINT, /* ... */<br>
<br>
- MESA_FORMAT_COUNT<br>
+ MESA_FORMAT_COUNT,<br>
+<br>
+ /*<br>
+ * Formats to exactly represent format/type combinations for OGLUser provided<br>
+ * textures. These formats are required only for caching of an unaltered copy of<br>
+ * the application texture prior to passing them to the GPU, where they are<br>
+ * processed to the final internalFormat and miptree location. Texstore functions<br>
+ * do not apply and these are not intended to be used as render targets.<br>
+ * Listing is based on the order presented in the glTexImage2D spec.<br>
+ */<br>
+ /* Red Solo - !cup */<br>
+ MESA_FORMAT_R32 = MESA_FORMAT_COUNT,<br>
+ MESA_FORMAT_SIGNED_R32,<br>
+<br>
+ /* Red Green - !show */<br>
+ MESA_FORMAT_SIGNED_RG88,<br>
+ MESA_FORMAT_SIGNED_RG1616,<br>
+ MESA_FORMAT_RG3232,<br>
+ MESA_FORMAT_SIGNED_RG3232,<br>
+<br>
+ /* Red Green Blue */<br>
+ MESA_FORMAT_SIGNED_RGB888,<br>
+ MESA_FORMAT_RGB161616,<br>
+ MESA_FORMAT_SIGNED_RGB161616,<br>
+ MESA_FORMAT_RGB323232,<br>
+ MESA_FORMAT_SIGNED_RGB323232,<br>
+ MESA_FORMAT_RGB233_REV,<br>
+ MESA_FORMAT_RGB101111_REV,<br>
+<br>
+ /* Blue Green Red */<br>
+ MESA_FORMAT_SIGNED_BGR888,<br>
+ MESA_FORMAT_BGR161616,<br>
+ MESA_FORMAT_SIGNED_BGR161616,<br>
+ MESA_FORMAT_BGR_FLOAT16,<br>
+ MESA_FORMAT_BGR323232,<br>
+ MESA_FORMAT_SIGNED_BGR323232,<br>
+ MESA_FORMAT_BGR_FLOAT32,<br>
+<br>
+ /* Red Green Blue Alpha */<br>
+ MESA_FORMAT_RGBA16161616,<br>
+ MESA_FORMAT_SIGNED_<u></u>RGBA16161616,<br>
+ MESA_FORMAT_RGBA32323232,<br>
+ MESA_FORMAT_SIGNED_<u></u>RGBA32323232,<br>
+ MESA_FORMAT_RGBA1010102,<br>
+ MESA_FORMAT_RGBA2101010_REV,<br>
+ MESA_FORMAT_RGBA5999_REV,<br>
+ MESA_FORMAT_RGBA4444,<br>
+ MESA_FORMAT_RGBA4444_REV,<br>
+ MESA_FORMAT_RGBA1555_REV,<br>
+<br>
+ /* Blue Green Red Alpha */<br>
+ MESA_FORMAT_BGRA8888,<br>
+ MESA_FORMAT_BGRA8888_REV,<br>
+ MESA_FORMAT_SIGNED_BGRA8888,<br>
+ MESA_FORMAT_BGRA16161616,<br>
+ MESA_FORMAT_SIGNED_<u></u>BGRA16161616,<br>
+ MESA_FORMAT_BGRA_FLOAT16,<br>
+ MESA_FORMAT_BGRA32323232,<br>
+ MESA_FORMAT_SIGNED_<u></u>BGRA32323232,<br>
+ MESA_FORMAT_BGRA_FLOAT32,<br>
+ MESA_FORMAT_BGRA4444,<br>
+ MESA_FORMAT_BGRA4444_REV,<br>
+ MESA_FORMAT_BGRA5551,<br>
+ MESA_FORMAT_BGRA1555_REV,<br>
+ MESA_FORMAT_BGRA1010102,<br>
+ MESA_FORMAT_BGRA2101010_REV,<br>
+ MESA_FORMAT_BGRA5999_REV,<br>
+<br>
+ MESA_PRIVATE_FORMAT_COUNT<br>
} gl_format;<br>
<br>
<br>
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c<br>
index d3aa477..713fdf2 100644<br>
--- a/src/mesa/main/texformat.c<br>
+++ b/src/mesa/main/texformat.c<br>
@@ -831,3 +831,274 @@ _mesa_tex_target_is_array(<u></u>GLenum target)<br>
return GL_FALSE;<br>
}<br>
}<br>
+<br>
+/**<br>
+ * Choose a texture format that exaclty matches the application texture<br>
</blockquote></div></div>
exactly.<div><div><br></div></div></blockquote><div><br></div><div>got-it.</div><div> </div><div><br></div><div><br></div></div><br></div></div>