zink: only set layer info for samplerviews if there are multiple layers

fixes a bunch of validation errors

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
This commit is contained in:
Mike Blumenkrantz
2021-04-02 14:51:17 -04:00
committed by Marge Bot
parent 3c1ecb93d3
commit b715aaa5f1
+4 -2
View File
@@ -530,8 +530,10 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres,
struct pipe_surface templ = {};
templ.u.tex.level = state->u.tex.first_level;
templ.format = state->format;
templ.u.tex.first_layer = state->u.tex.first_layer;
templ.u.tex.last_layer = state->u.tex.last_layer;
if (state->target != PIPE_TEXTURE_3D) {
templ.u.tex.first_layer = state->u.tex.first_layer;
templ.u.tex.last_layer = state->u.tex.last_layer;
}
ivci = create_ivci(screen, res, &templ, state->target);
ivci.subresourceRange.levelCount = state->u.tex.last_level - state->u.tex.first_level + 1;