summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_resource.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2012-12-13 04:44:21 +0800
committerChia-I Wu <[email protected]>2013-04-26 16:16:42 +0800
commit3a4a570c34eb20d28c24d1fd18c9781740abf6e5 (patch)
tree0bc6645f379858152ff48d53c8cd54c1a2d79ccf /src/gallium/drivers/ilo/ilo_resource.h
parentb50e68cb67534bd9e648b5cb687949d9327ee011 (diff)
ilo: hook up pipe screen resource functions
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.h')
-rw-r--r--src/gallium/drivers/ilo/ilo_resource.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/ilo_resource.h b/src/gallium/drivers/ilo/ilo_resource.h
index bfc506de711..ed9a2fa6798 100644
--- a/src/gallium/drivers/ilo/ilo_resource.h
+++ b/src/gallium/drivers/ilo/ilo_resource.h
@@ -28,10 +28,56 @@
#ifndef ILO_RESOURCE_H
#define ILO_RESOURCE_H
+#include "intel_winsys.h"
+
#include "ilo_common.h"
struct ilo_screen;
struct ilo_context;
+struct winsys_handle;
+
+/*
+ * TODO we should have
+ *
+ * ilo_resource, inherited by
+ * - ilo_buffer
+ * - ilo_texture
+ * - ilo_global_binding
+ */
+struct ilo_resource {
+ struct pipe_resource base;
+ struct winsys_handle *handle;
+
+ struct intel_bo *bo;
+
+ /*
+ * These are the values passed to or returned from winsys for bo
+ * allocation. As such,
+ *
+ * - width and height are in blocks,
+ * - cpp is the block size in bytes, and
+ * - stride is the distance in bytes between two block rows.
+ */
+ int bo_width, bo_height, bo_cpp, bo_stride;
+ enum intel_tiling_mode tiling;
+
+ bool compressed;
+ unsigned block_width;
+ unsigned block_height;
+ bool halign_8, valign_4;
+
+ /* 2D offsets into a layer/slice/face */
+ struct {
+ unsigned x;
+ unsigned y;
+ } *slice_offsets[PIPE_MAX_TEXTURE_LEVELS];
+};
+
+static inline struct ilo_resource *
+ilo_resource(struct pipe_resource *res)
+{
+ return (struct ilo_resource *) res;
+}
void
ilo_init_resource_functions(struct ilo_screen *is);