summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2017-02-17 10:14:59 -0800
committerNanley Chery <[email protected]>2017-03-02 13:17:54 -0800
commit54d29ee65f65b4e8541745d83bc741e68147cd28 (patch)
tree45bccb9c8f9da7c38363df580b634c67645d8ac4 /src/intel/vulkan/anv_private.h
parent172747a963f92f7d9a1a4eb5ef6683f53426af0b (diff)
anv: Update the HiZ sampling helper
Validate the inputs, verify that this image has a depth buffer, use gen_device_info instead of v2: - Add parenthesis (Jason Ekstrand) - Make parameters const - Use gen_device_info instead of gen - Pass aspect to missed function in transition_depth_buffer Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 3a9393bac83..49ca510998f 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1767,9 +1767,14 @@ struct anv_image {
/* 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)
+anv_can_sample_with_hiz(const struct gen_device_info * const devinfo,
+ const VkImageAspectFlags aspect_mask,
+ const uint32_t samples)
{
- return gen >= 8 && samples == 1;
+ /* Validate the inputs. */
+ assert(devinfo && aspect_mask && samples);
+ return devinfo->gen >= 8 && (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) &&
+ samples == 1;
}
void