diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-02-29 16:16:16 -0700 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-02-29 16:16:16 -0700 |
commit | 07d6347e8a51fc7bbd5c586a5739f17c68c5eafd (patch) | |
tree | ec2ba34d12827a1ea5078c35aea59c4148f34aff /src/mesa/state_tracker/st_atom_texture.c | |
parent | c8bca8d8a94b7bce532b40fd5c422063632b26c4 (diff) | |
download | external_mesa3d-07d6347e8a51fc7bbd5c586a5739f17c68c5eafd.zip external_mesa3d-07d6347e8a51fc7bbd5c586a5739f17c68c5eafd.tar.gz external_mesa3d-07d6347e8a51fc7bbd5c586a5739f17c68c5eafd.tar.bz2 |
gallium: change st->state.sampler_texture[] to store pipe_texture pointers
This is a better fix for the previous check-in.
Fixes texadd.c conform test, and probably other bugs.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 0e1c396..697d2cd 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -55,6 +55,7 @@ update_textures(struct st_context *st) const GLuint su = fprog->Base.SamplerUnits[unit]; struct gl_texture_object *texObj = st->ctx->Texture.Unit[su]._Current; struct st_texture_object *stObj = st_texture_object(texObj); + struct pipe_texture *pt; if (texObj) { GLboolean flush, retval; @@ -67,18 +68,15 @@ update_textures(struct st_context *st) * this table before being deleted, otherwise the pointer * comparison below could fail. */ - if (st->state.sampler_texture[unit] != stObj || - (stObj && stObj->dirtyData)) { - /* should really test if the bound 'pt' is changing */ - struct pipe_texture *pt = st_get_stobj_texture(stObj); - st->state.sampler_texture[unit] = stObj; + + pt = st_get_stobj_texture(stObj); + + if (st->state.sampler_texture[unit] != pt) { + st->state.sampler_texture[unit] = pt; st->pipe->set_sampler_texture(st->pipe, unit, pt); } - stObj = st->state.sampler_texture[unit]; - if (stObj && stObj->dirtyData) { - struct pipe_texture *pt = st_get_stobj_texture(stObj); st->pipe->texture_update(st->pipe, pt); stObj->dirtyData = GL_FALSE; } |