intel_set_texture_image_mt(struct brw_context *brw,
struct gl_texture_image *image,
GLenum internal_format,
+ mesa_format format,
struct intel_mipmap_tree *mt)
{
_mesa_init_teximage_fields(&brw->ctx, image,
mt->surf.logical_level0_px.width,
mt->surf.logical_level0_px.height, 1,
- 0, internal_format, mt->format);
+ 0, internal_format, format);
brw->ctx.Driver.FreeTextureImageBuffer(&brw->ctx, image);
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
mesa_format texFormat = MESA_FORMAT_NONE;
- struct intel_mipmap_tree *mt;
GLenum internal_format = 0;
texObj = _mesa_get_current_tex_object(ctx, target);
}
intel_miptree_make_shareable(brw, rb->mt);
- mt = intel_miptree_create_for_bo(brw, rb->mt->bo, texFormat, 0,
- rb->Base.Base.Width,
- rb->Base.Base.Height,
- 1, rb->mt->surf.row_pitch,
- rb->mt->surf.tiling,
- MIPTREE_CREATE_DEFAULT);
- if (mt == NULL)
- return;
- mt->target = target;
_mesa_lock_texture(&brw->ctx, texObj);
texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
- intel_set_texture_image_mt(brw, texImage, internal_format, mt);
- intel_miptree_release(&mt);
+ intel_set_texture_image_mt(brw, texImage, internal_format,
+ texFormat, rb->mt);
_mesa_unlock_texture(&brw->ctx, texObj);
}
const GLenum internal_format =
image->internal_format != 0 ?
image->internal_format : _mesa_get_format_base_format(mt->format);
- intel_set_texture_image_mt(brw, texImage, internal_format, mt);
+ intel_set_texture_image_mt(brw, texImage, internal_format, mt->format, mt);
intel_miptree_release(&mt);
}