i965: Use {} to initialize GENX_* structs.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_tex.c
index 1751f109f778693d3c9f6b5daeef89d806a0b0d2..7ce2ceb9a2f7f72e555d34a5ccd5adccaa7284d3 100644 (file)
@@ -94,7 +94,9 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
    } else {
       intel_image->mt = intel_miptree_create_for_teximage(brw, intel_texobj,
                                                           intel_image,
-                                                          0);
+                                                          1 /* samples */);
+      if (!intel_image->mt)
+         return false;
 
       /* Even if the object currently has a mipmap tree associated
        * with it, this one is a more likely candidate to represent the
@@ -147,7 +149,7 @@ intel_alloc_texture_storage(struct gl_context *ctx,
                                               first_image->TexFormat,
                                               0, levels - 1,
                                               width, height, depth,
-                                              num_samples,
+                                              MAX2(num_samples, 1),
                                               MIPTREE_LAYOUT_TILING_ANY);
 
       if (intel_texobj->mt == NULL) {
@@ -335,7 +337,8 @@ intel_set_texture_storage_for_buffer_object(struct gl_context *ctx,
 
    struct brw_bo *bo = intel_bufferobj_buffer(brw, intel_buffer_obj,
                                              buffer_offset,
-                                             row_stride * image->Height);
+                                             row_stride * image->Height,
+                                             !read_only);
    intel_texobj->mt =
       intel_miptree_create_for_bo(brw, bo,
                                   image->TexFormat,