radeon: always properly initialize stencil_offset field
[glsdk/libdrm.git] / radeon / radeon_surface.c
index adf209d043f8d1f26feb008c844c43d7e02911b4..704d8e798e61729521ad04d667f8bf11dcd7ace5 100644 (file)
@@ -565,8 +565,6 @@ static int eg_surface_init_1d(struct radeon_surface_manager *surf_man,
     tilew = 8;
     xalign = surf_man->hw_info.group_bytes / (tilew * surf->bpe * surf->nsamples);
     if (surf->flags & RADEON_SURF_SBUFFER) {
-        surf->stencil_offset = 0;
-        surf->stencil_tile_split = 0;
         xalign = surf_man->hw_info.group_bytes / (tilew * surf->nsamples);
     }
     xalign = MAX2(tilew, xalign);
@@ -607,7 +605,6 @@ static int eg_surface_init_2d(struct radeon_surface_manager *surf_man,
     unsigned slice_pt;
     unsigned i;
 
-    surf->stencil_offset = 0;
     /* compute tile values */
     tilew = 8;
     tileh = 8;
@@ -749,6 +746,9 @@ static int eg_surface_init(struct radeon_surface_manager *surf_man,
         return r;
     }
 
+    surf->stencil_offset = 0;
+    surf->stencil_tile_split = 0;
+
     /* check tiling mode */
     switch (mode) {
     case RADEON_SURF_MODE_LINEAR: