}
image->internal_format = _mesa_get_format_base_format(image->format);
- image->data = loaderPrivate;
+ image->driScrnPriv = screen->driScrnPriv;
+ image->loader_private = loaderPrivate;
return image;
}
image->modifier = tiling_to_modifier(
isl_tiling_to_i915_tiling(irb->mt->surf.tiling));
image->offset = 0;
- image->data = loaderPrivate;
+ image->driScrnPriv = context->driScreenPriv;
+ image->loader_private = loaderPrivate;
brw_bo_unreference(image->bo);
image->bo = irb->mt->bo;
brw_bo_reference(irb->mt->bo);
image->format = obj->Image[face][level]->TexFormat;
image->modifier = tiling_to_modifier(
isl_tiling_to_i915_tiling(iobj->mt->surf.tiling));
- image->data = loaderPrivate;
+ image->driScrnPriv = context->driScreenPriv;
+ image->loader_private = loaderPrivate;
intel_setup_image_from_mipmap_tree(brw, image, iobj->mt, level, zoffset);
image->dri_format = driGLFormatToImageFormat(image->format);
image->has_depthstencil = iobj->mt->stencil_mt? true : false;
static void
intel_destroy_image(__DRIimage *image)
{
+ const __DRIscreen * driScreen = image->driScrnPriv;
+ const __DRIimageLoaderExtension *imgLoader = driScreen->image.loader;
+ const __DRIdri2LoaderExtension *dri2Loader = driScreen->dri2.loader;
+
+ if (imgLoader && imgLoader->base.version >= 4 &&
+ imgLoader->destroyLoaderImageState) {
+ imgLoader->destroyLoaderImageState(image->loader_private);
+ } else if (dri2Loader && dri2Loader->base.version >= 5 &&
+ dri2Loader->destroyLoaderImageState) {
+ dri2Loader->destroyLoaderImageState(image->loader_private);
+ }
+
brw_bo_unreference(image->bo);
free(image);
}
image->tile_x = orig_image->tile_x;
image->tile_y = orig_image->tile_y;
image->has_depthstencil = orig_image->has_depthstencil;
- image->data = loaderPrivate;
+ image->driScrnPriv = orig_image->driScrnPriv;
+ image->loader_private = loaderPrivate;
image->aux_offset = orig_image->aux_offset;
image->aux_pitch = orig_image->aux_pitch;