aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrii Kryvytskyi <[email protected]>2019-05-13 15:19:03 +0300
committerKenneth Graunke <[email protected]>2019-05-14 21:16:11 -0700
commiteca53f00aa64b5d43a5a8980593bc9c62a297c8f (patch)
tree53519d4a91ef2b9801e39eba3d1954e7f54adce0 /src
parent49958c4b5d0abe703e5aa028253e9f5b0742d695 (diff)
iris: Check if resource has stencil before returning it
Signed-off-by: Andrii Kryvytskyi <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 2c0b6fc258e..3d4bfd6fd9f 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -204,7 +204,11 @@ iris_resource_get_separate_stencil(struct pipe_resource *p_res)
/* For packed depth-stencil, we treat depth as the primary resource
* and store S8 as the "second plane" resource.
*/
- return p_res->next;
+ if (p_res->next && p_res->next->format == PIPE_FORMAT_S8_UINT)
+ return p_res->next;
+
+ return NULL;
+
}
static void