It's a single atomic add, so it makes sense to inline it.
Improves performance in Piglit's drawoverhead microbenchmark's
"DrawArrays ( 1 VBO, 0 UBO, 0 ) w/ no state change" subtest by
0.400922% +/- 0.310389% (n=350) on my i7-7700HQ.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
return NULL;
}
-inline void
-brw_bo_reference(struct brw_bo *bo)
-{
- p_atomic_inc(&bo->refcount);
-}
-
int
brw_bo_busy(struct brw_bo *bo)
{
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
+#include "util/u_atomic.h"
#include "util/list.h"
#if defined(__cplusplus)
unsigned flags);
/** Takes a reference on a buffer object */
-void brw_bo_reference(struct brw_bo *bo);
+static inline void
+brw_bo_reference(struct brw_bo *bo)
+{
+ p_atomic_inc(&bo->refcount);
+}
/**
* Releases a reference on a buffer object, freeing the data if