summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-02-13 22:12:01 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:12 -0800
commit1b5c342f33d3c2d71ac754f66268b2915d2a49d1 (patch)
tree65917db7e16ca205cbfe3246e54f56407872615e /src/gallium/drivers/iris
parent07ec1f0b253c552bf6b60d5b67e11089db2673e3 (diff)
iris: Simplify iris_get_depth_stencil_resources
We can safely assume that the given resource is depth, depth/stencil, or stencil already. The stencil-only case is easily detectable with a single format check, and all other cases are handled identically. This saves some CPU overhead.
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 7302f2ec604..f67d8165bdf 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -187,14 +187,10 @@ iris_get_depth_stencil_resources(struct pipe_resource *res,
return;
}
- const struct util_format_description *desc =
- util_format_description(res->format);
-
- if (util_format_has_depth(desc)) {
+ if (res->format != PIPE_FORMAT_S8_UINT) {
*out_z = (void *) res;
*out_s = (void *) iris_resource_get_separate_stencil(res);
} else {
- assert(util_format_has_stencil(desc));
*out_z = NULL;
*out_s = (void *) res;
}