summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
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_image.c
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_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index a1720fcd7f6..4791465e48b 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -483,7 +483,6 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,
if (devinfo->gen < 8 && aspects == VK_IMAGE_ASPECT_STENCIL_BIT)
return ISL_AUX_USAGE_NONE;
- const bool has_depth = aspects & VK_IMAGE_ASPECT_DEPTH_BIT;
const bool color_aspect = aspects == VK_IMAGE_ASPECT_COLOR_BIT;
/* The following switch currently only handles depth stencil aspects.
@@ -523,7 +522,7 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,
assert(!color_aspect);
/* Fall-through */
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
- if (has_depth && anv_can_sample_with_hiz(devinfo->gen, image->samples))
+ if (anv_can_sample_with_hiz(devinfo, aspects, image->samples))
return ISL_AUX_USAGE_HIZ;
else
return ISL_AUX_USAGE_NONE;
@@ -684,8 +683,8 @@ anv_CreateImageView(VkDevice _device,
float red_clear_color = 0.0f;
enum isl_aux_usage surf_usage = image->aux_usage;
if (image->aux_usage == ISL_AUX_USAGE_HIZ) {
- if (iview->aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT &&
- anv_can_sample_with_hiz(device->info.gen, image->samples)) {
+ if (anv_can_sample_with_hiz(&device->info, iview->aspect_mask,
+ image->samples)) {
/* When a HiZ buffer is sampled on gen9+, ensure that
* the constant fast clear value is set in the surface state.
*/