nouveau: Map correct mip level when using the shadow (nv30, nv40).
authorYounes Manton <younes.m@gmail.com>
Wed, 21 Jan 2009 21:55:35 +0000 (16:55 -0500)
committerYounes Manton <younes.m@gmail.com>
Wed, 21 Jan 2009 21:55:35 +0000 (16:55 -0500)
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv40/nv40_screen.c

index 29356e8c1e536cc7cf5119c5ed7594b24f9464ab..1fac6d3df831b77379a3a2ce9eec764219ebea53 100644 (file)
@@ -145,14 +145,15 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
                        surface->texture->tex_usage = old_tex_usage;
 
                        assert(mt->shadow_tex->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR);
-                       mt->shadow_surface = screen->get_tex_surface
-                       (
-                               screen, mt->shadow_tex,
-                               surface->face, surface->level, surface->zslice,
-                               surface->usage
-                       );
                }
 
+               mt->shadow_surface = screen->get_tex_surface
+               (
+                       screen, mt->shadow_tex,
+                       surface->face, surface->level, surface->zslice,
+                       surface->usage
+               );
+
                surface_to_map = mt->shadow_surface;
        }
        else
index 9657a19c50fa4d0273b647b8201bf7ed312a4b9f..ab128fecda7bedda6ff919508b6c8055febf2a97 100644 (file)
@@ -154,14 +154,15 @@ nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
                        surface->texture->tex_usage = old_tex_usage;
 
                        assert(mt->shadow_tex->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR);
-                       mt->shadow_surface = screen->get_tex_surface
-                       (
-                               screen, mt->shadow_tex,
-                               surface->face, surface->level, surface->zslice,
-                               surface->usage
-                       );
                }
 
+               mt->shadow_surface = screen->get_tex_surface
+               (
+                       screen, mt->shadow_tex,
+                       surface->face, surface->level, surface->zslice,
+                       surface->usage
+               );
+
                surface_to_map = mt->shadow_surface;
        }
        else