summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_triangle.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-09-21 18:54:53 -0600
committerBrian Paul <[email protected]>2011-09-22 10:44:36 -0600
commiteaf376ba354db11f7729452060570b48a029c9a0 (patch)
tree64801ebcccfbe0f83dc4dffbf6feb75ac4457558 /src/mesa/swrast/s_triangle.c
parentde414f491526610bb260c73805c81ba413388e20 (diff)
mesa: move gl_texture_image::_IsPowerOfTwo into swrast
It's only used by swrast. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_triangle.c')
-rw-r--r--src/mesa/swrast/s_triangle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 8a9671aa08a..77bd2a35903 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -1038,11 +1038,14 @@ _swrast_choose_triangle( struct gl_context *ctx )
/* Ugh, we do a _lot_ of tests to pick the best textured tri func */
const struct gl_texture_object *texObj2D;
const struct gl_texture_image *texImg;
+ const struct swrast_texture_image *swImg;
GLenum minFilter, magFilter, envMode;
gl_format format;
texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX];
texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL;
+ swImg = swrast_texture_image_const(texImg);
+
format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE;
minFilter = texObj2D ? texObj2D->Sampler.MinFilter : GL_NONE;
magFilter = texObj2D ? texObj2D->Sampler.MagFilter : GL_NONE;
@@ -1057,7 +1060,7 @@ _swrast_choose_triangle( struct gl_context *ctx )
&& texObj2D->Sampler.WrapS == GL_REPEAT
&& texObj2D->Sampler.WrapT == GL_REPEAT
&& texObj2D->_Swizzle == SWIZZLE_NOOP
- && texImg->_IsPowerOfTwo
+ && swImg->_IsPowerOfTwo
&& texImg->Border == 0
&& texImg->Width == texImg->RowStride
&& (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888)