static bool
fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
- unsigned level, const struct pipe_box *box)
+ unsigned level, const struct pipe_box *box, uint64_t modifier)
{
struct pipe_context *pctx = &ctx->base;
struct pipe_resource *prsc = &rsc->base;
return false;
struct pipe_resource *pshadow =
- pctx->screen->resource_create(pctx->screen, prsc);
+ pctx->screen->resource_create_with_modifiers(pctx->screen,
+ prsc, &modifier, 1);
if (!pshadow)
return false;
/* try shadowing only if it avoids a flush, otherwise staging would
* be better:
*/
- if (needs_flush && fd_try_shadow_resource(ctx, rsc, level, box)) {
+ if (needs_flush && fd_try_shadow_resource(ctx, rsc, level,
+ box, DRM_FORMAT_MOD_LINEAR)) {
needs_flush = busy = false;
rebind_resource(ctx, prsc);
ctx->stats.shadow_uploads++;