summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-10-05 12:36:16 -0700
committerLionel Landwerlin <[email protected]>2017-10-06 16:32:19 +0100
commit185e719090c8d8a4056a041f3884d86ca224a400 (patch)
tree600bf47be5ff3ac594ecb1646222f0fed01596bd /src/intel/vulkan/anv_private.h
parent558d8a39794033762d8edb249e7334847d5d0a18 (diff)
anv: Take an image in can_sample_with_hiz
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 77106ca68a1..0513780ede5 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2381,13 +2381,15 @@ anv_fast_clear_state_entry_size(const struct anv_device *device)
/* Returns true if a HiZ-enabled depth buffer can be sampled from. */
static inline bool
anv_can_sample_with_hiz(const struct gen_device_info * const devinfo,
- const VkImageAspectFlags aspect_mask,
- const uint32_t samples)
+ const struct anv_image *image)
{
- /* Validate the inputs. */
- assert(devinfo && aspect_mask && samples);
- return devinfo->gen >= 8 && (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) &&
- samples == 1;
+ if (!(image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT))
+ return false;
+
+ if (devinfo->gen < 8)
+ return false;
+
+ return image->samples == 1;
}
void