From 15c210649d3547689be286af2a0707be7ec3cdf4 Mon Sep 17 00:00:00 2001 From: Feng Jiang Date: Mon, 20 Jun 2022 14:35:35 +0800 Subject: [PATCH] gallium/util: add a new helper function pipe_buffer_size() Signed-off-by: Feng Jiang Reviewed-by: Liming Sun Part-of: --- src/gallium/auxiliary/util/u_inlines.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 1f1215c7ff0..1e6ec06c95f 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -319,6 +319,13 @@ pipe_surface_equal(struct pipe_surface *s1, struct pipe_surface *s2) */ +static inline unsigned +pipe_buffer_size(const struct pipe_resource *buffer) +{ + return buffer->width0; +} + + /** * Create a new resource. * \param bind bitmask of PIPE_BIND_x flags