We're going to need more information from the surface. May as well future-proof the function while we're at it. --- src/intel/blorp/blorp.h | 4 ++-- src/intel/blorp/blorp_clear.c | 10 +++++----- src/intel/vulkan/genX_cmd_buffer.c | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index 81d2cb7b280..9bf62aaa8ae 100644 --- a/src/intel/blorp/blorp.h +++ b/src/intel/blorp/blorp.h @@ -185,8 +185,8 @@ blorp_clear_depth_stencil(struct blorp_batch *batch, bool clear_depth, float depth_value, uint8_t stencil_mask, uint8_t stencil_value); bool -blorp_can_hiz_clear_depth(uint8_t gen, enum isl_format format, - uint32_t num_samples, +blorp_can_hiz_clear_depth(const struct gen_device_info *devinfo, + const struct isl_surf *surf, uint32_t level, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1); void diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index 03badf83ada..7f0d3b70993 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -661,14 +661,14 @@ is_full_surface_clear(const struct isl_surf *surf, uint32_t level, } bool -blorp_can_hiz_clear_depth(uint8_t gen, enum isl_format format, - uint32_t num_samples, +blorp_can_hiz_clear_depth(const struct gen_device_info *devinfo, + const struct isl_surf *surf, uint32_t level, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1) { /* This function currently doesn't support any gen prior to gen8 */ - assert(gen >= 8); + assert(devinfo->gen >= 8); - if (gen == 8 && format == ISL_FORMAT_R16_UNORM) { + if (devinfo->gen == 8 && surf->format == ISL_FORMAT_R16_UNORM) { /* Apply the D16 alignment restrictions. On BDW, HiZ has an 8x4 sample * block with the following property: as the number of samples increases, * the number of pixels representable by this block decreases by a factor @@ -687,7 +687,7 @@ blorp_can_hiz_clear_depth(uint8_t gen, enum isl_format format, * Table: Pixel Dimensions in a HiZ Sample Block Pre-SKL */ const struct isl_extent2d sa_block_dim = - isl_get_interleaved_msaa_px_size_sa(num_samples); + isl_get_interleaved_msaa_px_size_sa(surf->samples); const uint8_t align_px_w = 8 / sa_block_dim.w; const uint8_t align_px_h = 4 / sa_block_dim.h; diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 8457ccf0882..12bf7d3bd35 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -406,9 +406,8 @@ depth_stencil_attachment_compute_aux_usage(struct anv_device *device, if (first_subpass_aux_usage != ISL_AUX_USAGE_HIZ) return; - if (!blorp_can_hiz_clear_depth(GEN_GEN, - iview->planes[0].isl.format, - iview->image->samples, + if (!blorp_can_hiz_clear_depth(&device->info, + &iview->image->planes[0].surface.isl, 0, render_area.offset.x, render_area.offset.y, render_area.offset.x + -- 2.19.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev