From 339aec7241f77fc027ee32d1537b30505c20028c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 31 Dec 2019 07:03:26 +1000 Subject: [PATCH] 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: --- src/gallium/auxiliary/util/u_inlines.h | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.30.2