gallium/util: add a new helper function pipe_buffer_size()
authorFeng Jiang <jiangfeng@kylinos.cn>
Mon, 20 Jun 2022 06:35:35 +0000 (14:35 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 Aug 2022 10:21:03 +0000 (10:21 +0000)
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Liming Sun <sunliming@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17157>

src/gallium/auxiliary/util/u_inlines.h

index 1f1215c..1e6ec06 100644 (file)
@@ -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