aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-07 10:46:04 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:12 -0800
commita7bc4d60749cc4dd81d46bdfebf2266def389b59 (patch)
treea6914be2d66e8df7285936dffaa0dc3c95fce6e0 /src
parentd0996d5fab6d0ef2ad6e046c2178cfc3488567e7 (diff)
iris: Add iris_resource fields for aux surfaces
But without fast clears or HiZ per-level tracking just yet.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c14
-rw-r--r--src/gallium/drivers/iris/iris_resource.h40
2 files changed, 54 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index f67d8165bdf..5dbc4f7de6c 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -197,11 +197,25 @@ iris_get_depth_stencil_resources(struct pipe_resource *res,
}
static void
+iris_resource_disable_aux(struct iris_resource *res)
+{
+ iris_bo_unreference(res->aux.bo);
+ free(res->aux.state);
+
+ res->aux.usage = ISL_AUX_USAGE_NONE;
+ res->aux.surf.size_B = 0;
+ res->aux.bo = NULL;
+ res->aux.state = NULL;
+}
+
+static void
iris_resource_destroy(struct pipe_screen *screen,
struct pipe_resource *resource)
{
struct iris_resource *res = (struct iris_resource *)resource;
+ iris_resource_disable_aux(res);
+
iris_bo_unreference(res->bo);
free(res);
}
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index 060472f6df3..80bde8a2108 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -67,6 +67,46 @@ struct iris_resource {
* in the past. Only meaningful for PIPE_BUFFER; used for flushing.
*/
unsigned bind_history;
+
+ /**
+ * Auxiliary buffer information (CCS, MCS, or HiZ).
+ */
+ struct {
+ /** The surface layout for the auxiliary buffer. */
+ struct isl_surf surf;
+
+ /** The buffer object containing the auxiliary data. */
+ struct iris_bo *bo;
+
+ /** Offset into 'bo' where the auxiliary surface starts. */
+ uint32_t offset;
+
+ /**
+ * \brief The type of auxiliary compression used by this resource.
+ *
+ * This describes the type of auxiliary compression that is intended to
+ * be used by this resource. An aux usage of ISL_AUX_USAGE_NONE means
+ * that auxiliary compression is permanently disabled. An aux usage
+ * other than ISL_AUX_USAGE_NONE does not imply that auxiliary
+ * compression will always be enabled for this surface.
+ */
+ enum isl_aux_usage usage;
+
+ /**
+ * A bitfield of ISL_AUX_* modes that might this resource might use.
+ *
+ * For example, a surface might use both CCS_E and CCS_D at times.
+ */
+ unsigned possible_usages;
+
+ /**
+ * \brief Maps miptree slices to their current aux state.
+ *
+ * This two-dimensional array is indexed as [level][layer] and stores an
+ * aux state for each slice.
+ */
+ enum isl_aux_state **state;
+ } aux;
};
/**