diff options
author | Dave Airlie <airlied@itt42.(none)> | 2009-11-20 11:48:10 +1000 |
---|---|---|
committer | Dave Airlie <airlied@itt42.(none)> | 2009-11-20 11:48:10 +1000 |
commit | 3f2c77659ca552c43f544228f3a5a5fe6365513a (patch) | |
tree | f98f22ac8a1dbcaa9c457d8f64731c6d4a374cdb /src/mesa/drivers/dri/r300/r300_tex.c | |
parent | b09e74901a4f92299fe3f52f57d27fd5ca5bdd2d (diff) | |
parent | f8ea5318200c1ed839fc387b16a57c8d9969974b (diff) |
Merge remote branch 'origin/mesa_7_7_branch'
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_tex.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_tex.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 27b78a912f..726b3ff98e 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -223,16 +223,7 @@ static void r300TexParameter(GLcontext * ctx, GLenum target, case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - t->validated = GL_FALSE; - } + t->validated = GL_FALSE; break; case GL_DEPTH_TEXTURE_MODE: @@ -270,7 +261,11 @@ static void r300DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) if (rmesa) { int i; - radeon_firevertices(&rmesa->radeon); + struct radeon_bo *bo; + bo = !t->mt ? t->bo : t->mt->bo; + if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->radeon.cmdbuf.cs)) { + radeon_firevertices(&rmesa->radeon); + } for(i = 0; i < R300_MAX_TEXTURE_UNITS; ++i) if (rmesa->hw.textures[i] == t) @@ -282,10 +277,8 @@ static void r300DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) t->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - } + radeon_miptree_unreference(&t->mt); + _mesa_delete_texture_object(ctx, texObj); } |