<div dir="ltr"><br>Also make it a compile-time error with STATIC_ASSERT.<br>---<br> src/mesa/main/teximage.c | 33 ++++++++++++++++++++-------------<br> 1 file changed, 20 insertions(+), 13 deletions(-)<br><br>diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
index b719fc8..7a1d808 100644<br>--- a/src/mesa/main/teximage.c<br>+++ b/src/mesa/main/teximage.c<br>@@ -661,22 +661,29 @@ _mesa_delete_texture_image(struct gl_context *ctx,<br> GLboolean<br> _mesa_is_proxy_texture(GLenum target)<br>
{<br>+ unsigned i;<br>+ static const GLenum targets[] = {<br>+ GL_PROXY_TEXTURE_1D,<br>+ GL_PROXY_TEXTURE_2D,<br>+ GL_PROXY_TEXTURE_3D,<br>+ GL_PROXY_TEXTURE_CUBE_MAP,<br>+ GL_PROXY_TEXTURE_RECTANGLE,<br>
+ GL_PROXY_TEXTURE_1D_ARRAY,<br>+ GL_PROXY_TEXTURE_2D_ARRAY,<br>+ GL_PROXY_TEXTURE_CUBE_MAP_ARRAY,<br>+ GL_PROXY_TEXTURE_2D_MULTISAMPLE,<br>+ GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY<br>+ };<br> /*<br>
- * NUM_TEXTURE_TARGETS should match number of terms below, except there's no<br>+ * NUM_TEXTURE_TARGETS should match number of terms above, except there's no<br> * proxy for GL_TEXTURE_BUFFER and GL_TEXTURE_EXTERNAL_OES.<br>
*/<br>- assert(NUM_TEXTURE_TARGETS == 10 + 2);<br>-<br>- return (target == GL_PROXY_TEXTURE_1D ||<br>- target == GL_PROXY_TEXTURE_2D ||<br>- target == GL_PROXY_TEXTURE_3D ||<br>- target == GL_PROXY_TEXTURE_CUBE_MAP_ARB ||<br>
- target == GL_PROXY_TEXTURE_RECTANGLE_NV ||<br>- target == GL_PROXY_TEXTURE_1D_ARRAY_EXT ||<br>- target == GL_PROXY_TEXTURE_2D_ARRAY_EXT ||<br>- target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY ||<br>
- target == GL_PROXY_TEXTURE_2D_MULTISAMPLE ||<br>- target == GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY);<br>+ STATIC_ASSERT(NUM_TEXTURE_TARGETS == Elements(targets) + 2);<br>+<br>+ for (i = 0; i < Elements(targets); ++i)<br>
+ if (target == targets[i])<br>+ return GL_TRUE;<br>+ return GL_FALSE;<br> }<br> <br> <br>-- <br>1.7.9.5<br><br></div>