ilo: make sure there is HiZ before resolving
authorChia-I Wu <olvaffe@gmail.com>
Thu, 22 Oct 2015 03:29:17 +0000 (11:29 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Thu, 22 Oct 2015 06:06:21 +0000 (14:06 +0800)
We do not want to perform a depth resolve on an MCS enabled surface.

src/gallium/drivers/ilo/ilo_blit.h

index da0bfe9c4c9e3a99bd77c1d588a6b8d8ebc19337..bad4dab8404466a9ea4deeadf9a180c8650e2e55 100644 (file)
@@ -58,10 +58,12 @@ ilo_blit_resolve_slices(struct ilo_context *ilo,
     * As it is only used to resolve HiZ right now, return early when there is
     * no HiZ.
     */
-   if (!ilo_image_can_enable_aux(&tex->image, level))
+   if (tex->image.aux.type != ILO_IMAGE_AUX_HIZ ||
+       !ilo_image_can_enable_aux(&tex->image, level))
       return;
 
-   if (ilo_image_can_enable_aux(&tex->image, level)) {
+   if (tex->image.aux.type == ILO_IMAGE_AUX_HIZ &&
+       ilo_image_can_enable_aux(&tex->image, level)) {
       ilo_blit_resolve_slices_for_hiz(ilo, res, level,
             first_slice, num_slices, resolve_flags);
    }