From: Dave Airlie Date: Thu, 20 Aug 2020 00:53:08 +0000 (+1000) Subject: vallium: handle 3D image views properly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=857008850f37886f3febeaaf3b4e42f3db4e7603;p=mesa.git 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: --- 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;