aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-06-09 09:27:21 +0200
committermarha <marha@users.sourceforge.net>2011-06-09 09:27:21 +0200
commit0de14292c4fac98f91105baf9cc16e58f25d4d77 (patch)
tree1704165c3d7f05bde08dc6d3d52ee33aed0f270f /mesalib/src/mesa/main/teximage.c
parent637bc31135b378ea9521b5a93b14bdce482da209 (diff)
parent0a9d2abef2e6fac5d52556969655a62711df6418 (diff)
downloadvcxsrv-0de14292c4fac98f91105baf9cc16e58f25d4d77.tar.gz
vcxsrv-0de14292c4fac98f91105baf9cc16e58f25d4d77.tar.bz2
vcxsrv-0de14292c4fac98f91105baf9cc16e58f25d4d77.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/include/GL/internal/dri_interface.h mesalib/src/gallium/auxiliary/util/u_math.h mesalib/src/mapi/glapi/gen/Makefile mesalib/src/mapi/glapi/gen/gl_table.py mesalib/src/mesa/SConscript mesalib/src/mesa/main/dlist.c mesalib/src/mesa/main/es_generator.py mesalib/src/mesa/main/imports.h mesalib/src/mesa/main/teximage.c mesalib/src/mesa/main/uniforms.c mesalib/src/mesa/state_tracker/st_draw.c mesalib/src/mesa/state_tracker/st_program.c mesalib/src/mesa/vbo/vbo_save_api.c xorg-server/xkeyboard-config/configure.in xorg-server/xkeyboard-config/rules/Makefile.am xorg-server/xkeyboard-config/rules/base.xml.in xorg-server/xkeyboard-config/symbols/cz xorg-server/xkeyboard-config/symbols/in
Diffstat (limited to 'mesalib/src/mesa/main/teximage.c')
-rw-r--r--mesalib/src/mesa/main/teximage.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index fa9783892..fcce7c5c8 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -80,23 +80,6 @@ _mesa_free_texmemory(void *m)
}
-/*
- * Returns the floor form of binary logarithm for a 32-bit integer.
- */
-static GLuint
-logbase2(GLuint n)
-{
- GLuint pos = 0;
- if (n >= 1<<16) { n >>= 16; pos += 16; }
- if (n >= 1<< 8) { n >>= 8; pos += 8; }
- if (n >= 1<< 4) { n >>= 4; pos += 4; }
- if (n >= 1<< 2) { n >>= 2; pos += 2; }
- if (n >= 1<< 1) { pos += 1; }
- return pos;
-}
-
-
-
/**
* Return the simple base format for a given internal texture format.
* For example, given GL_LUMINANCE12_ALPHA4, return GL_LUMINANCE_ALPHA.
@@ -1155,7 +1138,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
img->Depth = depth;
img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
- img->WidthLog2 = logbase2(img->Width2);
+ img->WidthLog2 = _mesa_logbase2(img->Width2);
if (height == 1) { /* 1-D texture */
img->Height2 = 1;
@@ -1163,7 +1146,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
}
else {
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
- img->HeightLog2 = logbase2(img->Height2);
+ img->HeightLog2 = _mesa_logbase2(img->Height2);
}
if (depth == 1) { /* 2-D texture */
@@ -1172,7 +1155,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
}
else {
img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
- img->DepthLog2 = logbase2(img->Depth2);
+ img->DepthLog2 = _mesa_logbase2(img->Depth2);
}
img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);