From 857008850f37886f3febeaaf3b4e42f3db4e7603 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 20 Aug 2020 10:53:08 +1000 Subject: [PATCH] vallium: handle 3D image views properly. Do pretty much what the gallium state tracker does here, and fill out first/last layer for 3D image views correctly. Fixes: dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_image*3d* Fixes: b38879f8c5f57b7f1802 ("vallium: initial import of the vulkan frontend") Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/frontends/vallium/val_execute.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/vallium/val_execute.c b/src/gallium/frontends/vallium/val_execute.c index 16699bf3e1f..2415c010b74 100644 --- a/src/gallium/frontends/vallium/val_execute.c +++ b/src/gallium/frontends/vallium/val_execute.c @@ -837,8 +837,14 @@ static void fill_image_view_stage(struct rendering_state *state, state->iv[p_stage][idx].format = util_format_stencil_only(vk_format_to_pipe(iv->format)); else state->iv[p_stage][idx].format = vk_format_to_pipe(iv->format); - state->iv[p_stage][idx].u.tex.first_layer = iv->subresourceRange.baseArrayLayer; - state->iv[p_stage][idx].u.tex.last_layer = iv->subresourceRange.baseArrayLayer + val_get_layerCount(iv->image, &iv->subresourceRange) - 1; + + if (iv->view_type == VK_IMAGE_VIEW_TYPE_3D) { + state->iv[p_stage][idx].u.tex.first_layer = 0; + state->iv[p_stage][idx].u.tex.last_layer = u_minify(iv->image->bo->depth0, iv->subresourceRange.baseMipLevel) - 1; + } else { + state->iv[p_stage][idx].u.tex.first_layer = iv->subresourceRange.baseArrayLayer; + state->iv[p_stage][idx].u.tex.last_layer = iv->subresourceRange.baseArrayLayer + val_get_layerCount(iv->image, &iv->subresourceRange) - 1; + } state->iv[p_stage][idx].u.tex.level = iv->subresourceRange.baseMipLevel; if (state->num_shader_images[p_stage] <= idx) state->num_shader_images[p_stage] = idx + 1; -- 2.30.2