ilo: OOM for HiZ is fatal on GEN6
authorChia-I Wu <olvaffe@gmail.com>
Tue, 14 Jan 2014 05:34:29 +0000 (13:34 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 14 Jan 2014 07:19:41 +0000 (15:19 +0800)
On GEN6, HiZ and Separate Stencil Buffer must be enabled at the same time.

src/gallium/drivers/ilo/ilo_resource.c

index 01d2d08..3ec8839 100644 (file)
@@ -1192,8 +1192,13 @@ tex_create(struct pipe_screen *screen,
       return NULL;
    }
 
-   if (layout.hiz)
-      tex_create_hiz(tex, &layout);
+   if (layout.hiz && !tex_create_hiz(tex, &layout)) {
+      /* Separate Stencil Buffer requires HiZ to be enabled */
+      if (layout.dev->gen == ILO_GEN(6) && layout.separate_stencil) {
+         tex_destroy(tex);
+         return NULL;
+      }
+   }
 
    return &tex->base;
 }