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=12a346838f37cc7cfd32cea21a1006651840fd9a;hpb=9694b23f66f4c41407289fb7d3ff25321042ef49;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c index 12a346838f3..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) { @@ -325,7 +327,7 @@ intel_set_texture_storage_for_buffer_object(struct gl_context *ctx, return false; } - if (!brw->format_supported_as_render_target[image->TexFormat]) { + if (!brw->mesa_format_supports_render[image->TexFormat]) { perf_debug("Non-renderable PBO format; fallback to CPU mapping\n"); return false; } @@ -333,9 +335,10 @@ intel_set_texture_storage_for_buffer_object(struct gl_context *ctx, assert(intel_texobj->mt == NULL); - drm_intel_bo *bo = intel_bufferobj_buffer(brw, intel_buffer_obj, + 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,