From: Dave Airlie Date: Mon, 30 Dec 2019 21:03:26 +0000 (+1000) Subject: util: add a resource wrapper to get resource samples X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=339aec7241f77fc027ee32d1537b30505c20028c;p=mesa.git util: add a resource wrapper to get resource samples This return 1 as a baseline and should be used in allocator paths. Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 8d656f63fa3..9a1315d01ec 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -773,6 +773,11 @@ pipe_create_multimedia_context(struct pipe_screen *screen) return screen->context_create(screen, NULL, flags); } +static inline unsigned util_res_sample_count(struct pipe_resource *res) +{ + return res->nr_samples > 0 ? res->nr_samples : 1; +} + #ifdef __cplusplus } #endif