summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2018-04-26 18:49:19 -0700
committerNanley Chery <[email protected]>2018-05-17 07:06:41 -0700
commit6f609ca609f3011b756bb920a7b06946a8a8c0b7 (patch)
tree4296735a35560028d22f8118cb6ab60b0201ba6f /src/mesa
parent92a0a87b6f78b316f47132bb8f67c1ba28d3c020 (diff)
i965: Use set_clear_color for depth miptrees
Reduce code duplication now and prevent it in the following commits. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clear.c3
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c13
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.h5
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