This function is only used in two places:
1. VMware driver, but only for HUD reporting
2. st/nine state tracker, used for texture memory accounting
Fixes: a69efa9482d ("util: add new util_resource_size() function in
u_resource.[ch]")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
unsigned depth = res->depth0;
unsigned size = 0;
unsigned level;
+ unsigned samples = MAX2(1, res->nr_samples);
for (level = 0; level <= res->last_level; level++) {
unsigned slices;
slices = res->array_size;
size += (util_format_get_nblocksy(res->format, height) *
- util_format_get_stride(res->format, width) * slices);
+ util_format_get_stride(res->format, width) * slices * samples);
width = u_minify(width, 1);
height = u_minify(height, 1);