Mesa (7.10): st/mesa: fix a regression from cae2bb76

Alex Deucher agd5f at kemper.freedesktop.org
Tue Feb 22 20:33:34 UTC 2011


Module: Mesa
Branch: 7.10
Commit: b847da213ea011da6c96fc67e47fcee5866c1f32
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b847da213ea011da6c96fc67e47fcee5866c1f32

Author: Fredrik Höglund <fredrik at kde.org>
Date:   Thu Jan  6 23:12:08 2011 +0100

st/mesa: fix a regression from cae2bb76

stObj->pt is null when a TFP texture is passed to st_finalize_texture,
and with the changes introduced in the above commit this resulted in a
new texture being created and the existing image being copied into it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Alex Deucher <alexdeucher at gmail.com>

---

 src/mesa/state_tracker/st_cb_texture.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 14d33f7..09a10ba 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1858,9 +1858,8 @@ st_finalize_texture(struct gl_context *ctx,
     * will match.
     */
    if (firstImage->pt &&
-       stObj->pt &&
        firstImage->pt != stObj->pt &&
-       firstImage->pt->last_level >= stObj->pt->last_level) {
+       (!stObj->pt || firstImage->pt->last_level >= stObj->pt->last_level)) {
       pipe_resource_reference(&stObj->pt, firstImage->pt);
       pipe_sampler_view_reference(&stObj->sampler_view, NULL);
    }




More information about the mesa-commit mailing list