Commit 21f47692 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen Committed by Marge Bot
Browse files

amd/common: Add modifier size helper.



For use in Vulkan.
Reviewed-By: chadversary's avatarChad Versace <chad@kiwitree.net>
Part-of: <mesa/mesa!7667>
parent a678ec9b
......@@ -2974,6 +2974,22 @@ uint64_t ac_surface_get_plane_stride(enum chip_class chip_class,
}
}
uint64_t ac_surface_get_plane_size(const struct radeon_surf *surf,
unsigned plane)
{
switch (plane) {
case 0:
return surf->surf_size;
case 1:
return surf->display_dcc_offset ?
surf->u.gfx9.display_dcc_size : surf->dcc_size;
case 2:
return surf->dcc_size;
default:
unreachable("Invalid plane index");
}
}
void ac_surface_print_info(FILE *out, const struct radeon_info *info,
const struct radeon_surf *surf)
{
......
......@@ -367,6 +367,9 @@ uint64_t ac_surface_get_plane_offset(enum chip_class chip_class,
uint64_t ac_surface_get_plane_stride(enum chip_class chip_class,
const struct radeon_surf *surf,
unsigned plane);
/* Of the whole miplevel, not an individual layer */
uint64_t ac_surface_get_plane_size(const struct radeon_surf *surf,
unsigned plane);
void ac_surface_print_info(FILE *out, const struct radeon_info *info,
const struct radeon_surf *surf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment