From 63bed3d55b77891633e24ddf212de7529240c184 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 18 Mar 2021 10:45:49 -0400 Subject: [PATCH] zink: correctly clamp samplerview surface types this fixes a bunch of cube stuff, e.g., spec@oes_texture_view@sampling-2d-array-as-cubemap-array Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_context.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index ac5d6884f29..ec785f80f92 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -632,11 +632,7 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres, ivci.subresourceRange.baseArrayLayer = state->u.tex.first_layer; ivci.subresourceRange.levelCount = state->u.tex.last_level - state->u.tex.first_level + 1; ivci.subresourceRange.layerCount = state->u.tex.last_layer - state->u.tex.first_layer + 1; - if (pres->target == PIPE_TEXTURE_CUBE || - pres->target == PIPE_TEXTURE_CUBE_ARRAY) { - if (ivci.subresourceRange.layerCount != 6) - ivci.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; - } + ivci.viewType = zink_surface_clamp_viewtype(ivci.viewType, state->u.tex.first_layer, state->u.tex.last_layer, pres->array_size); struct pipe_surface templ = {}; templ.u.tex.level = state->u.tex.first_level;