summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_image.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-10 22:14:39 +0200
committerDave Airlie <[email protected]>2017-06-05 10:43:53 +1000
commit59f72e158aa0349085ef25900eb1651aa67ec67f (patch)
tree9968d595d364f3c519714e18f611308281eb755f /src/amd/vulkan/radv_image.c
parenta12d288bff2277c9343fa22dd138f49447a8e258 (diff)
radv: remove radeon_surf_level::pitch_bytes
Like radeonsi. This saves memory, and the information can easily be recomputed on the fly where necessary. Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_image.c')
-rw-r--r--src/amd/vulkan/radv_image.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index d138988f56f..a1598fcbb7b 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -446,7 +446,7 @@ radv_init_metadata(struct radv_device *device,
metadata->tile_split = surface->tile_split;
metadata->mtilea = surface->mtilea;
metadata->num_banks = surface->num_banks;
- metadata->stride = surface->level[0].pitch_bytes;
+ metadata->stride = surface->level[0].nblk_x * surface->bpe;
metadata->scanout = (surface->flags & RADEON_SURF_SCANOUT) != 0;
radv_query_opaque_metadata(device, image, metadata);
@@ -677,13 +677,6 @@ radv_image_create(VkDevice _device,
radv_image_alloc_htile(device, image);
}
-
- if (create_info->stride && create_info->stride != image->surface.level[0].pitch_bytes) {
- image->surface.level[0].nblk_x = create_info->stride / image->surface.bpe;
- image->surface.level[0].pitch_bytes = create_info->stride;
- image->surface.level[0].slice_size = create_info->stride * image->surface.level[0].nblk_y;
- }
-
if (pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) {
image->alignment = MAX2(image->alignment, 4096);
image->size = align64(image->size, image->alignment);
@@ -856,7 +849,7 @@ void radv_GetImageSubresourceLayout(
struct radeon_surf *surface = &image->surface;
pLayout->offset = surface->level[level].offset + surface->level[level].slice_size * layer;
- pLayout->rowPitch = surface->level[level].pitch_bytes;
+ pLayout->rowPitch = surface->level[level].nblk_x * surface->bpe;
pLayout->arrayPitch = surface->level[level].slice_size;
pLayout->depthPitch = surface->level[level].slice_size;
pLayout->size = surface->level[level].slice_size;