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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
This commit is contained in:
Mike Blumenkrantz 2022-05-13 11:44:43 -04:00 committed by Marge Bot
parent 1526df283c
commit fa3d51892a
1 changed files with 1 additions and 1 deletions

View File

@ -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 {