etnaviv: optimize sampler source update
Now that we track age at the resource level we can optimize the sampler source update by only copying/flushing the levels that are actually used by the sampler. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
This commit is contained in:
@@ -172,16 +172,18 @@ etna_update_sampler_source(struct pipe_sampler_view *view, int num)
|
||||
to = etna_resource(base->texture);
|
||||
|
||||
if ((to != from) && etna_resource_older(to, from)) {
|
||||
etna_copy_resource(view->context, &to->base, &from->base, 0,
|
||||
view->texture->last_level);
|
||||
etna_copy_resource(view->context, &to->base, &from->base,
|
||||
view->u.tex.first_level,
|
||||
MIN2(view->texture->last_level, view->u.tex.last_level));
|
||||
ctx->dirty |= ETNA_DIRTY_TEXTURE_CACHES;
|
||||
} else if ((to == from) && etna_resource_needs_flush(to)) {
|
||||
if (etna_can_use_sampler_ts(view, num)) {
|
||||
enable_sampler_ts = true;
|
||||
} else {
|
||||
/* Resolve TS if needed */
|
||||
etna_copy_resource(view->context, &to->base, &from->base, 0,
|
||||
view->texture->last_level);
|
||||
etna_copy_resource(view->context, &to->base, &from->base,
|
||||
view->u.tex.first_level,
|
||||
MIN2(view->texture->last_level, view->u.tex.last_level));
|
||||
ctx->dirty |= ETNA_DIRTY_TEXTURE_CACHES;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user