From 3ac01ad2ac2aedee7e2515365d13c71a024878fb Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Mon, 9 Jan 2017 19:24:44 -0800 Subject: [PATCH] anv: Add a helper to determine sampling with HiZ Signed-off-by: Nanley Chery Reviewed-by: Jason Ekstrand --- src/intel/vulkan/anv_private.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index aa1b6a81ccf..2342fcbfeb4 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1609,6 +1609,13 @@ struct anv_image { struct anv_surface aux_surface; }; +/* Returns true if a HiZ-enabled depth buffer can be sampled from. */ +static inline bool +anv_can_sample_with_hiz(uint8_t gen, uint32_t samples) +{ + return gen >= 8 && samples == 1; +} + void anv_gen8_hiz_op_resolve(struct anv_cmd_buffer *cmd_buffer, const struct anv_image *image, -- 2.30.2