Fallback to software render if there is no miptree for an image
authorWill Dyson <will.dyson@gmail.com>
Tue, 25 May 2010 05:10:19 +0000 (01:10 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 26 May 2010 22:17:28 +0000 (18:17 -0400)
This can happen when checking if a software fallback for a higher level
operation (such as GenerateMipmap) is needed.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
src/mesa/drivers/dri/radeon/radeon_fbo.c

index 63986058356a79d8efd03ddd0f1e1c9620e11915..517485091a21bbb12ccbb65d4895a0365f567004 100644 (file)
@@ -506,9 +506,10 @@ radeon_render_texture(GLcontext * ctx,
 
    ASSERT(newImage);
 
-   if (newImage->Border != 0) {
-      /* Fallback on drawing to a texture with a border, which won't have a
-       * miptree.
+   radeon_image = (radeon_texture_image *)newImage;
+
+   if (!radeon_image->mt || newImage->Border != 0) {
+      /* Fallback on drawing to a texture without a miptree.
        */
       _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
       _mesa_render_texture(ctx, fb, att);
@@ -539,7 +540,6 @@ radeon_render_texture(GLcontext * ctx,
        rrb->base.RefCount);
 
    /* point the renderbufer's region to the texture image region */
-   radeon_image = (radeon_texture_image *)newImage;
    if (rrb->bo != radeon_image->mt->bo) {
       if (rrb->bo)
        radeon_bo_unref(rrb->bo);