r200: use _mesa_get_current_tex_object() in r200SetTexBuffer2()
authorBrian Paul <brianp@vmware.com>
Mon, 27 Jan 2014 19:04:01 +0000 (12:04 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 2 Feb 2014 13:47:32 +0000 (06:47 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/r200/r200_texstate.c

index 5160c2ce2d109fa16415aa5cbb94c040d5555f6b..c3c92cbca25de3d3dfe9b12fca5770a31613c992 100644 (file)
@@ -712,7 +712,6 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
 void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format,
                       __DRIdrawable *dPriv)
 {
-       struct gl_texture_unit *texUnit;
        struct gl_texture_object *texObj;
        struct gl_texture_image *texImage;
        struct radeon_renderbuffer *rb;
@@ -726,9 +725,8 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format
        radeon = pDRICtx->driverPrivate;
 
        rfb = dPriv->driverPrivate;
-        texUnit = &radeon->glCtx.Texture.Unit[radeon->glCtx.Texture.CurrentUnit];
-       texObj = _mesa_select_tex_object(&radeon->glCtx, texUnit, target);
-        texImage = _mesa_get_tex_image(&radeon->glCtx, texObj, target, 0);
+       texObj = _mesa_get_current_tex_object(&radeon->glCtx, target);
+       texImage = _mesa_get_tex_image(&radeon->glCtx, texObj, target, 0);
 
        rImage = get_radeon_texture_image(texImage);
        t = radeon_tex_obj(texObj);