mesa/st: update NumSparseLevels from pipe_resource

Add nr_sparse_levels in pipe_resource for updating the
gl_texture_object->NumSparseLevels.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14223>
This commit is contained in:
Qiang Yu 2021-12-10 09:53:59 +08:00
parent 90415c1a3a
commit 30daded7e9
2 changed files with 5 additions and 0 deletions

View file

@ -569,6 +569,8 @@ struct pipe_resource
*/
unsigned nr_storage_samples:8;
unsigned nr_sparse_levels:8; /**< Mipmap levels support partial resident */
unsigned usage:8; /**< PIPE_USAGE_x (not a bitmask) */
unsigned bind; /**< bitmask of PIPE_BIND_x */
unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */

View file

@ -3359,6 +3359,9 @@ st_texture_storage(struct gl_context *ctx,
}
}
/* Update gl_texture_object for texture parameter query. */
texObj->NumSparseLevels = stObj->pt->nr_sparse_levels;
/* The texture is in a validated state, so no need to check later. */
stObj->needs_validation = false;
stObj->validated_first_level = 0;