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 <kenneth@whitecape.org>
This commit is contained in:
@@ -86,6 +86,18 @@ struct iris_resource {
|
||||
/** Offset into 'bo' where the auxiliary surface starts. */
|
||||
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.
|
||||
*
|
||||
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user