summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-05-10 22:05:52 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-05-14 23:40:32 +0200
commitf07df55f321204c5f110876c1eb30d18e02f6eed (patch)
tree5310215ea7d0b9ba0fe6ba330eefbe6b59f8af2b
parent6e482413c84f5e61fae5977595f7177f8bed1c33 (diff)
radv: add surface helper variable in radv_GetImageSubresourceLayout
-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 e1e9d9c86b..c0fc89628c 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -848,14 +848,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;
}