Module: Mesa
Branch: main
Commit: 15c210649d3547689be286af2a0707be7ec3cdf4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=15c210649d3547689be286af2a0707be7ec3cdf4

Author: Feng Jiang <[email protected]>
Date:   Mon Jun 20 14:35:35 2022 +0800

gallium/util: add a new helper function pipe_buffer_size()

Signed-off-by: Feng Jiang <[email protected]>
Reviewed-by: Liming Sun <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17157>

---

 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

Reply via email to