u_blitter: don't fail mipmap generation for depth formats containing stencil

Submitted by Marek Olšák on May 27, 2019, 11:41 p.m.

Details

Message ID 20190527234136.30570-1-maraeo@gmail.com
State New
Headers show
Series "u_blitter: don't fail mipmap generation for depth formats containing stencil" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák May 27, 2019, 11:41 p.m.
From: Marek Olšák <marek.olsak@amd.com>

Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=109754

Cc: 19.0 19.1 <mesa-stable@lists.freedesktop.org>
---
 src/gallium/auxiliary/util/u_blitter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index e19fde9873d..3dc49cd0958 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -2052,21 +2052,22 @@  void util_blitter_generate_mipmap(struct blitter_context *blitter,
    const struct util_format_description *desc =
          util_format_description(format);
    unsigned src_level;
    unsigned target = tex->target;
 
    if (ctx->cube_as_2darray &&
        (target == PIPE_TEXTURE_CUBE || target == PIPE_TEXTURE_CUBE_ARRAY))
       target = PIPE_TEXTURE_2D_ARRAY;
 
    assert(tex->nr_samples <= 1);
-   assert(!util_format_has_stencil(desc));
+   /* Disallow stencil formats without depth. */
+   assert(!util_format_has_stencil(desc) || util_format_has_depth(desc));
 
    is_depth = desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS;
 
    /* Check whether the states are properly saved. */
    util_blitter_set_running_flag(blitter);
    blitter_check_saved_vertex_states(ctx);
    blitter_check_saved_fragment_states(ctx);
    blitter_check_saved_textures(ctx);
    blitter_check_saved_fb_state(ctx);
    blitter_disable_render_cond(ctx);