summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-10 22:05:52 +0200
committerDave Airlie <[email protected]>2017-06-05 10:43:50 +1000
commita12d288bff2277c9343fa22dd138f49447a8e258 (patch)
tree3235755086fd165f35db8b24bb855e1871514107 /src/amd
parent388d36dfd180bc16b9d2803d9a213aa5e5ee011f (diff)
radv: add surface helper variable in radv_GetImageSubresourceLayout
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_image.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 22bc6b41da8..d138988f56f 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -853,14 +853,15 @@ void radv_GetImageSubresourceLayout(
RADV_FROM_HANDLE(radv_image, image, _image);
int level = pSubresource->mipLevel;
int layer = pSubresource->arrayLayer;
+ struct radeon_surf *surface = &image->surface;
- pLayout->offset = image->surface.level[level].offset + image->surface.level[level].slice_size * layer;
- pLayout->rowPitch = image->surface.level[level].pitch_bytes;
- pLayout->arrayPitch = image->surface.level[level].slice_size;
- pLayout->depthPitch = image->surface.level[level].slice_size;
- pLayout->size = image->surface.level[level].slice_size;
+ pLayout->offset = surface->level[level].offset + surface->level[level].slice_size * layer;
+ pLayout->rowPitch = surface->level[level].pitch_bytes;
+ pLayout->arrayPitch = surface->level[level].slice_size;
+ pLayout->depthPitch = surface->level[level].slice_size;
+ pLayout->size = surface->level[level].slice_size;
if (image->type == VK_IMAGE_TYPE_3D)
- pLayout->size *= image->surface.level[level].nblk_z;
+ pLayout->size *= surface->level[level].nblk_z;
}