summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c9
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c4
-rw-r--r--src/mesa/state_tracker/st_context.h1
3 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index eeaf68b001..bafd38695f 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 cdb9ebc3ff..7a89e853ee 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 8ce85cddaa..8d82d53133 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;