swrast: Use fixed-function processing instead _TexEnvProgram for DrawPixels
[mesa.git] / src / mesa / swrast / s_texture.c
index e31cd62679b00c1474e60dd1df20422fda015a08..337a52f32a049dec412475b7821e6cef3fca3e25 100644 (file)
@@ -189,6 +189,9 @@ _swrast_map_teximage(struct gl_context *ctx,
    stride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width);
    _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
 
+   assert(x % bw == 0);
+   assert(y % bh == 0);
+
    if (!swImage->Buffer) {
       /* probably ran out of memory when allocating tex mem */
       *mapOut = NULL;
@@ -282,7 +285,7 @@ _swrast_map_textures(struct gl_context *ctx)
 
    /* loop over enabled texture units */
    while (enabledUnits) {
-      GLuint unit = _mesa_ffs(enabledUnits) - 1;
+      GLuint unit = ffs(enabledUnits) - 1;
       struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
       
       _swrast_map_texture(ctx, texObj);
@@ -302,7 +305,7 @@ _swrast_unmap_textures(struct gl_context *ctx)
 
    /* loop over enabled texture units */
    while (enabledUnits) {
-      GLuint unit = _mesa_ffs(enabledUnits) - 1;
+      GLuint unit = ffs(enabledUnits) - 1;
       struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
       
       _swrast_unmap_texture(ctx, texObj);