diff options
author | Chad Versace <[email protected]> | 2015-04-06 06:54:30 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-04-13 07:32:02 -0700 |
commit | e1338f267fa5670fc02a450774fa89b42e990883 (patch) | |
tree | d26201655ec70580593207f52940cdcd6d3950eb /src/mesa/drivers/dri/i965/brw_surface_formats.c | |
parent | 5776d65114b553643eea74c58699910cbdb29b55 (diff) |
i965: Refactor brw_is_hiz_depth_format()
Every caller of this function uses it to determine if the current
miptree needs a hiz buffer to be allocated. Strangely, the function
doesn't take a miptree argument. So, this function effectively decides
if and when a miptree's hiz buffer gets allocated without inspecting the
miptree itself. Luckily, the driver behaves correctly despite the
brw_is_hiz_depth_format's quirk.
I will soon make some changes to the miptree that will require
inspecting the miptree to determine if it needs a hiz buffer. So this
patch renames
brw_is_hiz_depth_format -> intel_miptree_wants_hiz_buffer
and gives it a miptree parameter.
This patch shouldn't change any behavior.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_surface_formats.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_surface_formats.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c index 7524ad9675d..c7fb7073381 100644 --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c @@ -798,22 +798,3 @@ brw_depth_format(struct brw_context *brw, mesa_format format) unreachable("Unexpected depth format."); } } - -/** Can HiZ be enabled on a depthbuffer of the given format? */ -bool -brw_is_hiz_depth_format(struct brw_context *brw, mesa_format format) -{ - if (!brw->has_hiz) - return false; - - switch (format) { - case MESA_FORMAT_Z_FLOAT32: - case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: - case MESA_FORMAT_Z24_UNORM_X8_UINT: - case MESA_FORMAT_Z24_UNORM_S8_UINT: - case MESA_FORMAT_Z_UNORM16: - return true; - default: - return false; - } -} |