fix some issues with texture/mipmap_tree state tracking
This commit is contained in:
@@ -51,8 +51,8 @@ update_textures(struct st_context *st)
|
|||||||
for (u = 0; u < st->ctx->Const.MaxTextureImageUnits; u++) {
|
for (u = 0; u < st->ctx->Const.MaxTextureImageUnits; u++) {
|
||||||
struct gl_texture_object *texObj
|
struct gl_texture_object *texObj
|
||||||
= st->ctx->Texture.Unit[u]._Current;
|
= st->ctx->Texture.Unit[u]._Current;
|
||||||
if (texObj) {
|
|
||||||
struct pipe_mipmap_tree *mt;
|
struct pipe_mipmap_tree *mt;
|
||||||
|
if (texObj) {
|
||||||
GLboolean flush, retval;
|
GLboolean flush, retval;
|
||||||
|
|
||||||
retval = st_finalize_mipmap_tree(st->ctx, st->pipe, u, &flush);
|
retval = st_finalize_mipmap_tree(st->ctx, st->pipe, u, &flush);
|
||||||
@@ -60,12 +60,13 @@ update_textures(struct st_context *st)
|
|||||||
retval, flush);
|
retval, flush);
|
||||||
|
|
||||||
mt = st_get_texobj_mipmap_tree(texObj);
|
mt = st_get_texobj_mipmap_tree(texObj);
|
||||||
|
|
||||||
st->pipe->set_texture_state(st->pipe, u, mt);
|
|
||||||
}
|
}
|
||||||
else {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -315,8 +315,8 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
|
|||||||
/* restore GL state */
|
/* restore GL state */
|
||||||
pipe->set_setup_state(pipe, &ctx->st->state.setup);
|
pipe->set_setup_state(pipe, &ctx->st->state.setup);
|
||||||
pipe->set_fs_state(pipe, &ctx->st->state.fs);
|
pipe->set_fs_state(pipe, &ctx->st->state.fs);
|
||||||
/* XXX FIX: pipe->set_texture_state(pipe, unit, ???); */
|
pipe->set_texture_state(pipe, unit, ctx->st->state.texture[unit]);
|
||||||
pipe->set_sampler_state(pipe, unit, &ctx->st->state.sampler[0]);
|
pipe->set_sampler_state(pipe, unit, &ctx->st->state.sampler[unit]);
|
||||||
|
|
||||||
free_mipmap_tree(pipe, mt);
|
free_mipmap_tree(pipe, mt);
|
||||||
}
|
}
|
||||||
|
@@ -79,6 +79,7 @@ struct st_context
|
|||||||
struct pipe_scissor_state scissor;
|
struct pipe_scissor_state scissor;
|
||||||
struct pipe_setup_state setup;
|
struct pipe_setup_state setup;
|
||||||
struct pipe_stencil_state stencil;
|
struct pipe_stencil_state stencil;
|
||||||
|
struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS];
|
||||||
struct pipe_viewport_state viewport;
|
struct pipe_viewport_state viewport;
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user