From fa3d51892aa8b36e476bd07626f5f93d03e57f48 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 13 May 2022 11:44:43 -0400 Subject: [PATCH] zink: fix 3d shader image miplevel calc for depth without adjusting for miplevel here, the shader image might erroneously be created as a 2d view and/or assert cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 9be51807b81..60f425cd1a1 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1414,7 +1414,7 @@ create_image_surface(struct zink_context *ctx, const struct pipe_image_view *vie unsigned depth = 1 + tmpl.u.tex.last_layer - tmpl.u.tex.first_layer; switch (target) { case PIPE_TEXTURE_3D: - if (depth < res->base.b.depth0) { + if (depth < u_minify(res->base.b.depth0, view->u.tex.level)) { assert(depth == 1); target = PIPE_TEXTURE_2D; } else {