diff options
Diffstat (limited to 'lib/mesa/src/gallium/drivers/svga/svga_resource_texture.h')
-rw-r--r-- | lib/mesa/src/gallium/drivers/svga/svga_resource_texture.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/mesa/src/gallium/drivers/svga/svga_resource_texture.h b/lib/mesa/src/gallium/drivers/svga/svga_resource_texture.h index e1872faad..32b42dd0e 100644 --- a/lib/mesa/src/gallium/drivers/svga/svga_resource_texture.h +++ b/lib/mesa/src/gallium/drivers/svga/svga_resource_texture.h @@ -1,5 +1,5 @@ /********************************************************** - * Copyright 2008-2009 VMware, Inc. All rights reserved. + * Copyright 2008-2023 VMware, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -85,6 +85,11 @@ struct svga_texture */ boolean can_use_upload; + /** + * Whether texture is modified. Set if any of the dirty bits is set. + */ + boolean modified; + unsigned size; /**< Approximate size in bytes */ /** array indexed by cube face or 3D/array slice, one bit per mipmap level */ @@ -242,6 +247,7 @@ svga_set_texture_dirty(struct svga_texture *tex, { check_face_level(tex, face, level); tex->dirty[face] |= 1 << level; + tex->modified = TRUE; } static inline void @@ -251,16 +257,23 @@ svga_clear_texture_dirty(struct svga_texture *tex) for (i = 0; i < tex->b.depth0 * tex->b.array_size; i++) { tex->dirty[i] = 0; } + tex->modified = FALSE; } static inline boolean -svga_is_texture_dirty(const struct svga_texture *tex, - unsigned face, unsigned level) +svga_is_texture_level_dirty(const struct svga_texture *tex, + unsigned face, unsigned level) { check_face_level(tex, face, level); return !!(tex->dirty[face] & (1 << level)); } +static inline boolean +svga_is_texture_dirty(const struct svga_texture *tex) +{ + return tex->modified; +} + struct pipe_resource * svga_texture_create(struct pipe_screen *screen, const struct pipe_resource *template); |