const struct anv_address clear_color_addr =
anv_image_get_clear_color_addr(device, image, aspect);
blorp_surf->clear_color_addr = anv_to_blorp_address(clear_color_addr);
- } else if (aspect & VK_IMAGE_ASPECT_DEPTH_BIT
- && device->info.gen >= 10) {
- /* Vulkan always clears to 1.0. On gen < 10, we set that directly in
- * the state packet. For gen >= 10, must provide the clear value in a
- * buffer. We have a single global buffer that stores the 1.0 value.
- */
- const struct anv_address clear_color_addr = (struct anv_address) {
- .bo = device->hiz_clear_bo,
- };
- blorp_surf->clear_color_addr = anv_to_blorp_address(clear_color_addr);
+ } else if (aspect & VK_IMAGE_ASPECT_DEPTH_BIT) {
+ if (device->info.gen >= 10) {
+ /* Vulkan always clears to 1.0. On gen < 10, we set that directly
+ * in the state packet. For gen >= 10, must provide the clear
+ * value in a buffer. We have a single global buffer that stores
+ * the 1.0 value.
+ */
+ const struct anv_address clear_color_addr = (struct anv_address) {
+ .bo = device->hiz_clear_bo,
+ };
+ blorp_surf->clear_color_addr =
+ anv_to_blorp_address(clear_color_addr);
+ } else {
+ blorp_surf->clear_color = (union isl_color_value) {
+ .f32 = { ANV_HZ_FC_VAL },
+ };
+ }
}
}
}
*/
case VK_IMAGE_LAYOUT_GENERAL:
case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
- case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {
/* This buffer could be a depth buffer used in a transfer operation.
* BLORP currently doesn't use HiZ for transfer operations so we must
case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL:
assert((image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0);
/* Fall-through */
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {
if (anv_can_sample_with_hiz(devinfo, image))