summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_resource.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-07-28 23:52:54 +0800
committerChia-I Wu <[email protected]>2014-07-28 23:55:55 +0800
commitfb1820355b0178f04622201688449cf2154feb42 (patch)
tree591958ad2ff9ff8714f6db30e1d20db3f13e127a /src/gallium/drivers/ilo/ilo_resource.h
parent6f0c1f2b5f8f1895878fcbf0b8d1b1ebcb719d70 (diff)
ilo: add ilo_resource_get_bo() helper
We will need it in the following commit.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.h')
-rw-r--r--src/gallium/drivers/ilo/ilo_resource.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/ilo_resource.h b/src/gallium/drivers/ilo/ilo_resource.h
index 5af9cc1b440..b0eab5b9c0e 100644
--- a/src/gallium/drivers/ilo/ilo_resource.h
+++ b/src/gallium/drivers/ilo/ilo_resource.h
@@ -160,6 +160,16 @@ ilo_buffer_rename_bo(struct ilo_buffer *buf);
bool
ilo_texture_rename_bo(struct ilo_texture *tex);
+/**
+ * Return the bo of the resource.
+ */
+static inline struct intel_bo *
+ilo_resource_get_bo(struct pipe_resource *res)
+{
+ return (res->target == PIPE_BUFFER) ?
+ ilo_buffer(res)->bo : ilo_texture(res)->bo;
+}
+
static inline struct ilo_texture_slice *
ilo_texture_get_slice(const struct ilo_texture *tex,
unsigned level, unsigned slice)