anv: Add a helper to determine sampling with HiZ
authorNanley Chery <nanley.g.chery@intel.com>
Tue, 10 Jan 2017 03:24:44 +0000 (19:24 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 13 Jan 2017 04:52:20 +0000 (20:52 -0800)
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_private.h

index aa1b6a81ccfdc6faaf3aed799b50f4cf46fee7a8..2342fcbfeb4d2553a7f9bad62d928ea723a2350f 100644 (file)
@@ -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,