From 6f609ca609f3011b756bb920a7b06946a8a8c0b7 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Thu, 26 Apr 2018 18:49:19 -0700 Subject: [PATCH] i965: Use set_clear_color for depth miptrees Reduce code duplication now and prevent it in the following commits. Reviewed-by: Topi Pohjolainen Reviewed-by: Jason Ekstrand --- src/mesa/drivers/dri/i965/brw_clear.c | 3 ++- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 13 ------------- src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 5 ----- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c index 3d540d6d905..2f61ea8ef15 100644 --- a/src/mesa/drivers/dri/i965/brw_clear.c +++ b/src/mesa/drivers/dri/i965/brw_clear.c @@ -213,7 +213,8 @@ brw_fast_clear_depth(struct gl_context *ctx) } } - intel_miptree_set_depth_clear_value(brw, mt, clear_value); + const union isl_color_value clear_color = { .f32 = {clear_value, } }; + intel_miptree_set_clear_color(brw, mt, clear_color); same_clear_value = false; } diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 506cf73e62c..88db0fc80b7 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -3734,19 +3734,6 @@ intel_miptree_set_clear_color(struct brw_context *brw, return false; } -bool -intel_miptree_set_depth_clear_value(struct brw_context *brw, - struct intel_mipmap_tree *mt, - float clear_value) -{ - if (mt->fast_clear_color.f32[0] != clear_value) { - mt->fast_clear_color.f32[0] = clear_value; - brw->ctx.NewDriverState |= BRW_NEW_AUX_STATE; - return true; - } - return false; -} - union isl_color_value intel_miptree_get_clear_color(const struct gen_device_info *devinfo, const struct intel_mipmap_tree *mt, diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h index 2d827afa534..42f73ba1f96 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h @@ -716,11 +716,6 @@ intel_miptree_get_clear_color(const struct gen_device_info *devinfo, struct brw_bo **clear_color_bo, uint32_t *clear_color_offset); -bool -intel_miptree_set_depth_clear_value(struct brw_context *brw, - struct intel_mipmap_tree *mt, - float clear_value); - #ifdef __cplusplus } #endif -- 2.30.2