From: Brian Date: Mon, 13 Aug 2007 21:20:08 +0000 (-0600) Subject: fix some issues with texture/mipmap_tree state tracking X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8cc668a4a8d67af21af6883e18fe7423f28999f9;p=mesa.git fix some issues with texture/mipmap_tree state tracking --- diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index eeaf68b0012..bafd38695f6 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -51,8 +51,8 @@ update_textures(struct st_context *st) for (u = 0; u < st->ctx->Const.MaxTextureImageUnits; u++) { struct gl_texture_object *texObj = st->ctx->Texture.Unit[u]._Current; + struct pipe_mipmap_tree *mt; if (texObj) { - struct pipe_mipmap_tree *mt; GLboolean flush, retval; retval = st_finalize_mipmap_tree(st->ctx, st->pipe, u, &flush); @@ -60,12 +60,13 @@ update_textures(struct st_context *st) retval, flush); mt = st_get_texobj_mipmap_tree(texObj); - - st->pipe->set_texture_state(st->pipe, u, mt); } else { - st->pipe->set_texture_state(st->pipe, u, NULL); + mt = NULL; } + + st->state.texture[u] = mt; + st->pipe->set_texture_state(st->pipe, u, mt); } } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index cdb9ebc3ff2..7a89e853ee5 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -315,8 +315,8 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, /* restore GL state */ pipe->set_setup_state(pipe, &ctx->st->state.setup); pipe->set_fs_state(pipe, &ctx->st->state.fs); - /* XXX FIX: pipe->set_texture_state(pipe, unit, ???); */ - pipe->set_sampler_state(pipe, unit, &ctx->st->state.sampler[0]); + pipe->set_texture_state(pipe, unit, ctx->st->state.texture[unit]); + pipe->set_sampler_state(pipe, unit, &ctx->st->state.sampler[unit]); free_mipmap_tree(pipe, mt); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 8ce85cddaaa..8d82d53133f 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -79,6 +79,7 @@ struct st_context struct pipe_scissor_state scissor; struct pipe_setup_state setup; struct pipe_stencil_state stencil; + struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS]; struct pipe_viewport_state viewport; } state;