diff options
author | Kenneth Graunke <[email protected]> | 2018-08-03 01:24:51 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:08 -0800 |
commit | 9ec2d3640e2f96ec3720a7fef7aa646df0b487c7 (patch) | |
tree | 572ba298302b1856f6a9bb840405e46d165cf03d /src/gallium | |
parent | 763f9095ea55d57fb90ee2d204669e2c5ec9b752 (diff) |
iris: depth or stencil fixes
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 79dcd94566d..4930def9098 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -198,12 +198,12 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen, if (!res) return NULL; - bool depth = util_format_is_depth_or_stencil(templ->format); + bool depth_or_stencil = util_format_is_depth_or_stencil(templ->format); uint64_t modifier = DRM_FORMAT_MOD_INVALID; if (modifiers_count == 0 || !modifiers) { - if (depth) { + if (depth_or_stencil) { modifier = I915_FORMAT_MOD_Y_TILED; } else if (templ->bind & PIPE_BIND_DISPLAY_TARGET) { /* Display is X-tiled for historical reasons. */ @@ -236,16 +236,17 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen, templ->target == PIPE_TEXTURE_CUBE_ARRAY) usage |= ISL_SURF_USAGE_CUBE_BIT; - // XXX: separate stencil... - enum pipe_format pfmt = templ->format; - - if (util_format_is_depth_or_stencil(pfmt) && - templ->usage != PIPE_USAGE_STAGING) + if (depth_or_stencil && templ->usage != PIPE_USAGE_STAGING) usage |= ISL_SURF_USAGE_DEPTH_BIT; + enum pipe_format pfmt = templ->format; + if (util_format_is_depth_and_stencil(pfmt)) { - // XXX: Z32S8 - pfmt = PIPE_FORMAT_Z24X8_UNORM; + struct pipe_resource t = *templ; + t.format = PIPE_FORMAT_S8_UINT; + res->base.next = + iris_resource_create_with_modifiers(pscreen, &t, NULL, 0); + pfmt = util_format_get_depth_only(pfmt); } enum isl_format isl_format = iris_isl_format_for_pipe_format(pfmt); |