summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2018-03-28 18:06:58 -0700
committerNanley Chery <[email protected]>2018-04-09 10:56:48 -0700
commit1d94aa19877fb702ffacacde28ad7253cce72c97 (patch)
tree67b86e9fc96afb1bc100e738f33a69d7e6cc879f
parent3dbb49a97809cd3a9911d2782bb7b03f8ae1a7d8 (diff)
i965: Make the miptree clear color setter take a gl_color_union
We want to hide the internal details of how the miptree's clear color is calculated. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.c5
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c6
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.h2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 0ccfa212547..5dcd95e9f44 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -1235,12 +1235,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
if (can_fast_clear) {
const enum isl_aux_state aux_state =
intel_miptree_get_aux_state(irb->mt, irb->mt_level, irb->mt_layer);
- union isl_color_value clear_color =
- brw_meta_convert_fast_clear_color(brw, irb->mt,
- &ctx->Color.ClearColor);
bool same_clear_color =
- !intel_miptree_set_clear_color(brw, irb->mt, clear_color);
+ !intel_miptree_set_clear_color(brw, irb->mt, &ctx->Color.ClearColor);
/* If the buffer is already in INTEL_FAST_CLEAR_STATE_CLEAR, the clear
* is redundant and can be skipped.
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 32be4b033eb..8d3ddd56544 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -36,6 +36,7 @@
#include "brw_blorp.h"
#include "brw_context.h"
+#include "brw_meta_util.h"
#include "brw_state.h"
#include "main/enums.h"
@@ -3808,8 +3809,11 @@ intel_miptree_get_aux_isl_usage(const struct brw_context *brw,
bool
intel_miptree_set_clear_color(struct brw_context *brw,
struct intel_mipmap_tree *mt,
- union isl_color_value clear_color)
+ const union gl_color_union *color)
{
+ const union isl_color_value clear_color =
+ brw_meta_convert_fast_clear_color(brw, mt, color);
+
if (memcmp(&mt->fast_clear_color, &clear_color, sizeof(clear_color)) != 0) {
mt->fast_clear_color = clear_color;
brw->ctx.NewDriverState |= BRW_NEW_AUX_STATE;
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index ff6ce4ecf9e..4136c6586b6 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -734,7 +734,7 @@ intel_miptree_sample_with_hiz(struct brw_context *brw,
bool
intel_miptree_set_clear_color(struct brw_context *brw,
struct intel_mipmap_tree *mt,
- union isl_color_value clear_color);
+ const union gl_color_union *color);
bool
intel_miptree_set_depth_clear_value(struct brw_context *brw,