if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
usage |= PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
- if (!pscreen->resource_get_handle(pscreen, NULL, image->texture,
- &whandle, usage))
+ for (i = 0, tex = image->texture; tex; i++, tex = tex->next)
+ if (i == image->plane)
+ break;
+ assert(tex);
+
+ if (!pscreen->resource_get_handle(pscreen, NULL, tex, &whandle, usage))
return false;
switch (attrib) {
unsigned handle_usage, uint64_t *value)
{
struct pipe_screen *pscreen = image->texture->screen;
+ struct pipe_resource *tex;
+ int i;
+
if (!pscreen->resource_get_param)
return false;
- return pscreen->resource_get_param(pscreen, NULL, image->texture,
+ for (i = 0, tex = image->texture; tex; i++, tex = tex->next)
+ if (i == image->plane)
+ break;
+ assert(tex);
+
+ return pscreen->resource_get_param(pscreen, NULL, tex,
image->plane, 0, 0, param, handle_usage,
value);
}