X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fintel_tex.c;h=7ce2ceb9a2f7f72e555d34a5ccd5adccaa7284d3;hb=8c47ccb13a198f4d38c772df1de457de34dde23e;hp=1751f109f778693d3c9f6b5daeef89d806a0b0d2;hpb=c09b2aefae95db6ebf3f7b10c6d69286eddb2dd4;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c index 1751f109f77..7ce2ceb9a2f 100644 --- a/src/mesa/drivers/dri/i965/intel_tex.c +++ b/src/mesa/drivers/dri/i965/intel_tex.c @@ -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,