i965: Use {} to initialize GENX_* structs.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_tex_image.c
index 494db68662ec0644f91586e819215825b821f64d..beed1609bdfdc1200d809c7b3ed3567ce270e16d 100644 (file)
@@ -62,16 +62,12 @@ intel_miptree_create_for_teximage(struct brw_context *brw,
 
    intel_get_image_dims(&intelImage->base.Base, &width, &height, &depth);
 
-   if (old_mt && old_mt->surf.size > 0) {
+   if (old_mt) {
       old_width = old_mt->surf.logical_level0_px.width;
       old_height = old_mt->surf.logical_level0_px.height;
       old_depth = old_mt->surf.dim == ISL_SURF_DIM_3D ?
                      old_mt->surf.logical_level0_px.depth :
                      old_mt->surf.logical_level0_px.array_len;
-   } else if (old_mt) {
-      old_width = old_mt->logical_width0;
-      old_height = old_mt->logical_height0;
-      old_depth = old_mt->logical_depth0;
    }
 
    DBG("%s\n", __func__);
@@ -199,14 +195,15 @@ intel_set_texture_image_mt(struct brw_context *brw,
    struct intel_texture_image *intel_image = intel_texture_image(image);
 
    _mesa_init_teximage_fields(&brw->ctx, image,
-                             mt->logical_width0, mt->logical_height0, 1,
-                             0, internal_format, mt->format);
+                              mt->surf.logical_level0_px.width,
+                              mt->surf.logical_level0_px.height, 1,
+                              0, internal_format, mt->format);
 
    brw->ctx.Driver.FreeTextureImageBuffer(&brw->ctx, image);
 
    intel_texobj->needs_validate = true;
-   intel_image->base.RowStride = mt->pitch / mt->cpp;
-   assert(mt->pitch % mt->cpp == 0);
+   intel_image->base.RowStride = mt->surf.row_pitch / mt->cpp;
+   assert(mt->surf.row_pitch % mt->cpp == 0);
 
    intel_miptree_reference(&intel_image->mt, mt);
 
@@ -264,7 +261,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    mt = intel_miptree_create_for_bo(brw, rb->mt->bo, texFormat, 0,
                                     rb->Base.Base.Width,
                                     rb->Base.Base.Height,
-                                    1, rb->mt->pitch, 0);
+                                    1, rb->mt->surf.row_pitch, 0);
    if (mt == NULL)
        return;
    mt->target = target;
@@ -455,7 +452,9 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx,
    /* Since we are going to write raw data to the miptree, we need to resolve
     * any pending fast color clears before we start.
     */
-   assert(image->mt->logical_depth0 == 1);
+   assert(image->mt->surf.logical_level0_px.depth == 1);
+   assert(image->mt->surf.logical_level0_px.array_len == 1);
+
    intel_miptree_access_raw(brw, image->mt, level, 0, true);
 
    bo = image->mt->bo;
@@ -492,7 +491,7 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx,
       yoffset, yoffset + height,
       pixels - (ptrdiff_t) yoffset * dst_pitch - (ptrdiff_t) xoffset * cpp,
       map,
-      dst_pitch, image->mt->pitch,
+      dst_pitch, image->mt->surf.row_pitch,
       brw->has_swizzling,
       image->mt->surf.tiling,
       mem_copy