summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_resource.h
diff options
context:
space:
mode:
authorRafael Antognolli <[email protected]>2019-02-15 14:45:05 -0800
committerRafael Antognolli <[email protected]>2019-03-20 16:46:25 -0700
commit37f2692591cb1af12325d16f7fea17cc761ae9d5 (patch)
tree56b28ac27727560f6f138e047a5b748b2ad9b2fc /src/gallium/drivers/iris/iris_resource.h
parent5f5ac19f138125b04d8ddedd6334b996f8925a4a (diff)
iris: Allocate buffer space for the fast clear color.
Also store clear color in the iris_resource. Always allocate clear color state buffer. v2: - Make clear_color_offset be 64 bits (Ken). - Simplify the logic to decide when to memset the aux buffer (Ken). Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_resource.h')
-rw-r--r--src/gallium/drivers/iris/iris_resource.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index d6bef37d898..3349d3eafc0 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -87,6 +87,18 @@ struct iris_resource {
uint32_t offset;
/**
+ * Fast clear color for this surface. For depth surfaces, the clear
+ * value is stored as a float32 in the red component.
+ */
+ union isl_color_value clear_color;
+
+ /** Buffer object containing the indirect clear color. */
+ struct iris_bo *clear_color_bo;
+
+ /** Offset into bo where the clear color can be found. */
+ uint64_t clear_color_offset;
+
+ /**
* \brief The type of auxiliary compression used by this resource.
*
* This describes the type of auxiliary compression that is intended to
@@ -207,6 +219,13 @@ struct pipe_resource *iris_resource_get_separate_stencil(struct pipe_resource *)
void iris_get_depth_stencil_resources(struct pipe_resource *res,
struct iris_resource **out_z,
struct iris_resource **out_s);
+bool iris_resource_set_clear_color(struct iris_context *ice,
+ struct iris_resource *res,
+ union isl_color_value color);
+union isl_color_value
+iris_resource_get_clear_color(const struct iris_resource *res,
+ struct iris_bo **clear_color_bo,
+ uint64_t *clear_color_offset);
void iris_init_screen_resource_functions(struct pipe_screen *pscreen);