diff options
author | Rob Clark <[email protected]> | 2020-04-24 14:45:04 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-29 00:08:57 +0000 |
commit | f12188ff5264b29f6270c40c7592543aca6c2f4a (patch) | |
tree | 0554ecf21dc7e215a3d04e4edcc1eb59bec9035c /src/gallium/drivers/freedreno/freedreno_texture.c | |
parent | 1e18c58047ef5920dbe442bc6fc42e62dc0edb7d (diff) |
freedreno: optimize rebind_resource()
Track how resources are used, ie. which state they may potentially dirty
if the backing bo is changed/reallocated, to optimize rebind_resource().
This will be more important in a later patch when we hook up eviction of
entries in a6xx tex state cache.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4744>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_texture.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_texture.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c index 84b4df6c1dc..5b0bec17f5d 100644 --- a/src/gallium/drivers/freedreno/freedreno_texture.c +++ b/src/gallium/drivers/freedreno/freedreno_texture.c @@ -75,10 +75,12 @@ static void set_sampler_views(struct fd_texture_stateobj *tex, struct pipe_sampler_view *view = views ? views[i] : NULL; unsigned p = i + start; pipe_sampler_view_reference(&tex->textures[p], view); - if (tex->textures[p]) + if (tex->textures[p]) { + fd_resource_set_usage(tex->textures[p]->texture, FD_DIRTY_TEX); tex->valid_textures |= (1 << p); - else + } else { tex->valid_textures &= ~(1 << p); + } } tex->num_textures = util_last_bit(tex->valid_textures); |