static __DRIimage *
dri2_create_image_from_winsys(__DRIscreen *_screen,
- int width, int height, enum pipe_format pf,
+ int width, int height, const struct dri2_format_mapping *map,
int num_handles, struct winsys_handle *whandle,
void *loaderPrivate)
{
struct pipe_resource templ;
unsigned tex_usage = 0;
int i;
+ enum pipe_format pf = map->pipe_format;
if (pscreen->is_format_supported(pscreen, pf, screen->target, 0, 0,
PIPE_BIND_RENDER_TARGET))
whandle.stride = pitch * util_format_get_blocksize(map->pipe_format);
- img = dri2_create_image_from_winsys(_screen, width, height, map->pipe_format,
+ img = dri2_create_image_from_winsys(_screen, width, height, map,
1, &whandle, loaderPrivate);
if (!img)
map = dri2_get_mapping_by_fourcc(fourcc);
}
- img = dri2_create_image_from_winsys(_screen, width, height, map->pipe_format,
+ img = dri2_create_image_from_winsys(_screen, width, height, map,
num_fds, whandles, loaderPrivate);
if(img == NULL) {
err = __DRI_IMAGE_ERROR_BAD_ALLOC;
whandle.offset = offsets[0];
whandle.modifier = DRM_FORMAT_MOD_INVALID;
- img = dri2_create_image_from_winsys(screen, width, height, map->pipe_format,
+ img = dri2_create_image_from_winsys(screen, width, height, map,
1, &whandle, loaderPrivate);
if (img == NULL)
return NULL;