summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_image.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-05-24 11:37:06 +1000
committerDave Airlie <[email protected]>2017-06-06 08:22:45 +1000
commitd1a4d229ec15653c3a3d2d7f270d74288d1aaa21 (patch)
tree181aa918746b9fbbb30b1068693d649da8b35e03 /src/amd/vulkan/radv_image.c
parentd987f90354822f97b36a559212a273c21b5d396f (diff)
radv: split metadata struct into legacy/gfx9 parts.
This is just ported from radeonsi. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_image.c')
-rw-r--r--src/amd/vulkan/radv_image.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 6f2f89c6e38..376de71d755 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -443,19 +443,23 @@ radv_init_metadata(struct radv_device *device,
struct radeon_surf *surface = &image->surface;
memset(metadata, 0, sizeof(*metadata));
- metadata->microtile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_1D ?
- RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR;
- metadata->macrotile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_2D ?
- RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR;
- metadata->pipe_config = surface->u.legacy.pipe_config;
- metadata->bankw = surface->u.legacy.bankw;
- metadata->bankh = surface->u.legacy.bankh;
- metadata->tile_split = surface->u.legacy.tile_split;
- metadata->mtilea = surface->u.legacy.mtilea;
- metadata->num_banks = surface->u.legacy.num_banks;
- metadata->stride = surface->u.legacy.level[0].nblk_x * surface->bpe;
- metadata->scanout = (surface->flags & RADEON_SURF_SCANOUT) != 0;
+ if (device->physical_device->rad_info.chip_class >= GFX9) {
+ metadata->u.gfx9.swizzle_mode = surface->u.gfx9.surf.swizzle_mode;
+ } else {
+ metadata->u.legacy.microtile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_1D ?
+ RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR;
+ metadata->u.legacy.macrotile = surface->u.legacy.level[0].mode >= RADEON_SURF_MODE_2D ?
+ RADEON_LAYOUT_TILED : RADEON_LAYOUT_LINEAR;
+ metadata->u.legacy.pipe_config = surface->u.legacy.pipe_config;
+ metadata->u.legacy.bankw = surface->u.legacy.bankw;
+ metadata->u.legacy.bankh = surface->u.legacy.bankh;
+ metadata->u.legacy.tile_split = surface->u.legacy.tile_split;
+ metadata->u.legacy.mtilea = surface->u.legacy.mtilea;
+ metadata->u.legacy.num_banks = surface->u.legacy.num_banks;
+ metadata->u.legacy.stride = surface->u.legacy.level[0].nblk_x * surface->bpe;
+ metadata->u.legacy.scanout = (surface->flags & RADEON_SURF_SCANOUT) != 0;
+ }
radv_query_opaque_metadata(device, image, metadata);
}