From: Brian Ho Date: Mon, 13 Apr 2020 21:57:45 +0000 (-0700) Subject: turnip: Correctly set layer stride for 3D images X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6d5ee29ab715c08d3b46e270f7eacde28e2e665;p=mesa.git turnip: Correctly set layer stride for 3D images Previously we were using layout.layer_size for the layer stride, but in Vulkan, you can alias a 3D image as an array of 2D images via the VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT flag. One reason to use this behavior is so the geometry shader can write to a specific depth in a 3D framebuffer with gl_Layer. Since the 3D image is not a *true* layered image, layer_size is 0. Instead, we can copy what freedreno does and use the slice size. Fixes dEQP-VK.geometry.layered.3d.* Part-of: --- diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index a15797e1042..633ca11324c 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -392,7 +392,8 @@ tu6_emit_zs(struct tu_cmd_buffer *cmd, tu_cs_emit_regs(cs, A6XX_RB_DEPTH_BUFFER_INFO(.depth_format = fmt), A6XX_RB_DEPTH_BUFFER_PITCH(tu_image_stride(iview->image, iview->base_mip)), - A6XX_RB_DEPTH_BUFFER_ARRAY_PITCH(iview->image->layout.layer_size), + A6XX_RB_DEPTH_BUFFER_ARRAY_PITCH( + fdl_layer_stride(&iview->image->layout, iview->base_mip)), A6XX_RB_DEPTH_BUFFER_BASE(tu_image_view_base_ref(iview)), A6XX_RB_DEPTH_BUFFER_BASE_GMEM(cmd->state.pass->attachments[a].gmem_offset)); @@ -444,7 +445,8 @@ tu6_emit_mrt(struct tu_cmd_buffer *cmd, .color_format = format.fmt, .color_swap = format.swap), A6XX_RB_MRT_PITCH(i, tu_image_stride(iview->image, iview->base_mip)), - A6XX_RB_MRT_ARRAY_PITCH(i, iview->image->layout.layer_size), + A6XX_RB_MRT_ARRAY_PITCH(i, + fdl_layer_stride(&iview->image->layout, iview->base_mip)), A6XX_RB_MRT_BASE(i, tu_image_view_base_ref(iview)), A6XX_RB_MRT_BASE_GMEM(i, cmd->state.pass->attachments[a].gmem_offset));