From e90e3e39c24e0120558b33006bc5e2b69f4638b0 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 14 Jan 2014 13:34:29 +0800 Subject: [PATCH] ilo: OOM for HiZ is fatal on GEN6 On GEN6, HiZ and Separate Stencil Buffer must be enabled at the same time. --- src/gallium/drivers/ilo/ilo_resource.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/ilo/ilo_resource.c b/src/gallium/drivers/ilo/ilo_resource.c index 01d2d0853ec..3ec8839eac5 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -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; } -- 2.30.2