diff options
author | Marek Olšák <[email protected]> | 2017-11-14 19:31:39 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-11-27 14:44:04 +0100 |
commit | ec15ff78c3ed4a2b39a45ecf74292090fdc99c6e (patch) | |
tree | 402ff736cdafe380b67414ffa659d34e2257ab7b /src/amd | |
parent | 474b4a919181a155187446ca0e0c0b3522fbdee2 (diff) |
ac: change legacy_surf_level::slice_size to dword units
The next commit will reduce the size even more.
v2: typecast to uint64_t manually
v3: add more typecasts, add asserts
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_surface.c | 2 | ||||
-rw-r--r-- | src/amd/common/ac_surface.h | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_image.c | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index f7600a35b26..2b6c3fb0135 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -304,7 +304,7 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib, surf_level = is_stencil ? &surf->u.legacy.stencil_level[level] : &surf->u.legacy.level[level]; surf_level->offset = align64(surf->surf_size, AddrSurfInfoOut->baseAlign); - surf_level->slice_size = AddrSurfInfoOut->sliceSize; + surf_level->slice_size_dw = AddrSurfInfoOut->sliceSize / 4; surf_level->nblk_x = AddrSurfInfoOut->pitch; surf_level->nblk_y = AddrSurfInfoOut->height; diff --git a/src/amd/common/ac_surface.h b/src/amd/common/ac_surface.h index 1dc95cd0883..ec89f6b5bb9 100644 --- a/src/amd/common/ac_surface.h +++ b/src/amd/common/ac_surface.h @@ -71,7 +71,7 @@ enum radeon_micro_mode { struct legacy_surf_level { uint64_t offset; - uint64_t slice_size; + uint32_t slice_size_dw; /* in dwords; max = 4GB / 4. */ uint32_t dcc_offset; /* relative offset within DCC mip tree */ uint32_t dcc_fast_clear_size; uint16_t nblk_x; diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index b532aa916ae..c241e369b91 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1156,11 +1156,11 @@ void radv_GetImageSubresourceLayout( if (image->type == VK_IMAGE_TYPE_3D) pLayout->size *= u_minify(image->info.depth, level); } else { - pLayout->offset = surface->u.legacy.level[level].offset + surface->u.legacy.level[level].slice_size * layer; + pLayout->offset = surface->u.legacy.level[level].offset + (uint64_t)surface->u.legacy.level[level].slice_size_dw * 4 * layer; pLayout->rowPitch = surface->u.legacy.level[level].nblk_x * surface->bpe; - pLayout->arrayPitch = surface->u.legacy.level[level].slice_size; - pLayout->depthPitch = surface->u.legacy.level[level].slice_size; - pLayout->size = surface->u.legacy.level[level].slice_size; + pLayout->arrayPitch = (uint64_t)surface->u.legacy.level[level].slice_size_dw * 4; + pLayout->depthPitch = (uint64_t)surface->u.legacy.level[level].slice_size_dw * 4; + pLayout->size = (uint64_t)surface->u.legacy.level[level].slice_size_dw * 4; if (image->type == VK_IMAGE_TYPE_3D) pLayout->size *= u_minify(image->info.depth, level); } |