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 <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user