From: Nanley Chery Date: Fri, 27 Apr 2018 01:49:19 +0000 (-0700) Subject: i965: Use set_clear_color for depth miptrees X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f609ca609f3011b756bb920a7b06946a8a8c0b7;p=mesa.git 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 --- 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