mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
anv: Move assert in vkGetImageSubresourceLayout
Assert the value is valid before we use it. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1466>
This commit is contained in:
parent
3a62d02c17
commit
46f0e5b1e9
1 changed files with 2 additions and 2 deletions
|
|
@ -1624,6 +1624,8 @@ void anv_GetImageSubresourceLayout(
|
|||
{
|
||||
ANV_FROM_HANDLE(anv_image, image, _image);
|
||||
|
||||
assert(__builtin_popcount(subresource->aspectMask) == 1);
|
||||
|
||||
const struct anv_surface *surface;
|
||||
if (subresource->aspectMask == VK_IMAGE_ASPECT_PLANE_1_BIT &&
|
||||
image->drm_format_mod != DRM_FORMAT_MOD_INVALID &&
|
||||
|
|
@ -1640,8 +1642,6 @@ void anv_GetImageSubresourceLayout(
|
|||
surface = &image->planes[plane].primary_surface;
|
||||
}
|
||||
|
||||
assert(__builtin_popcount(subresource->aspectMask) == 1);
|
||||
|
||||
layout->offset = surface->memory_range.offset;
|
||||
layout->rowPitch = surface->isl.row_pitch_B;
|
||||
layout->depthPitch = isl_surf_get_array_pitch(&surface->isl);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue