summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2014-01-14 13:34:29 +0800
committerChia-I Wu <olvaffe@gmail.com>2014-01-14 15:19:41 +0800
commite90e3e39c24e0120558b33006bc5e2b69f4638b0 (patch)
treec70a4dfb34b2ba1ae18669c7101cb14fda197537
parent5b1c516080989c950796a1e9087a07284887602b (diff)
ilo: OOM for HiZ is fatal on GEN6
On GEN6, HiZ and Separate Stencil Buffer must be enabled at the same time.
-rw-r--r--src/gallium/drivers/ilo/ilo_resource.c9
1 files 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;
}