diff options
author | Brian Ho <[email protected]> | 2020-04-13 14:57:45 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-15 16:19:34 +0000 |
commit | d6d5ee29ab715c08d3b46e270f7eacde28e2e665 (patch) | |
tree | d54ce8dee0a96536456c49c9f6c9241f53668f4e | |
parent | 7e525d29ab68d927d0f2aa7e3ef21d25e915e76d (diff) |
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4541>
-rw-r--r-- | src/freedreno/vulkan/tu_cmd_buffer.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)); |