[Mesa-dev] [PATCH 18/22] anv/cmd_buffer: Perform color buffer layout transitions
Nanley Chery
nanleychery at gmail.com
Tue May 2 22:46:01 UTC 2017
On Thu, Apr 27, 2017 at 11:32:17AM -0700, Nanley Chery wrote:
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
> src/intel/vulkan/genX_cmd_buffer.c | 65 ++++++++++++++++++++++++++++++--------
> 1 file changed, 52 insertions(+), 13 deletions(-)
>
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> index 1ae0c3256e..95729ec8a8 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -1150,12 +1150,24 @@ void genX(CmdPipelineBarrier)(
> for (uint32_t i = 0; i < imageMemoryBarrierCount; i++) {
> src_flags |= pImageMemoryBarriers[i].srcAccessMask;
> dst_flags |= pImageMemoryBarriers[i].dstAccessMask;
> + /* Perform layout transitions. */
> ANV_FROM_HANDLE(anv_image, image, pImageMemoryBarriers[i].image);
> - if (pImageMemoryBarriers[i].subresourceRange.aspectMask &
> - VK_IMAGE_ASPECT_DEPTH_BIT) {
> + const struct VkImageSubresourceRange * const range =
> + &pImageMemoryBarriers[i].subresourceRange;
> + if (range->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) {
> transition_depth_buffer(cmd_buffer, image,
> pImageMemoryBarriers[i].oldLayout,
> pImageMemoryBarriers[i].newLayout);
> + } else if (range->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) {
> + const uint32_t layers = image->type == VK_IMAGE_TYPE_3D ?
> + anv_get_sliceCount(image, range) :
Jason pointed out to me that apps can't transition individual layers of
a 3D image. The v2 of this series will replace the anv_get_sliceCount()
call with image->extent.depth and will drop the previous patch.
More information about the mesa-dev
mailing list