mesa: new _mesa_is_pow_two() function
This commit is contained in:
@@ -150,7 +150,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values )
|
||||
|
||||
if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
|
||||
/* test that mapsize is a power of two */
|
||||
if (_mesa_bitcount((GLuint) mapsize) != 1) {
|
||||
if (!_mesa_is_pow_two(mapsize)) {
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
|
||||
return;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
|
||||
|
||||
if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
|
||||
/* test that mapsize is a power of two */
|
||||
if (_mesa_bitcount((GLuint) mapsize) != 1) {
|
||||
if (!_mesa_is_pow_two(mapsize)) {
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
|
||||
return;
|
||||
}
|
||||
@@ -282,7 +282,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
|
||||
|
||||
if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
|
||||
/* test that mapsize is a power of two */
|
||||
if (_mesa_bitcount((GLuint) mapsize) != 1) {
|
||||
if (!_mesa_is_pow_two(mapsize)) {
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user