mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01:00
radv: provide a helper for comparing an image extents.
This just makes it easier to do the follow in cleanups of the surface. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
80ac89a952
commit
d5400a5ec2
2 changed files with 11 additions and 2 deletions
|
|
@ -614,7 +614,7 @@ static bool depth_view_can_fast_clear(const struct radv_image_view *iview,
|
||||||
iview->base_mip == 0 &&
|
iview->base_mip == 0 &&
|
||||||
iview->base_layer == 0 &&
|
iview->base_layer == 0 &&
|
||||||
radv_layout_can_expclear(iview->image, layout) &&
|
radv_layout_can_expclear(iview->image, layout) &&
|
||||||
memcmp(&iview->extent, &iview->image->extent, sizeof(iview->extent)) == 0)
|
!radv_image_extent_compare(iview->image, &iview->extent))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -858,7 +858,7 @@ emit_fast_color_clear(struct radv_cmd_buffer *cmd_buffer,
|
||||||
if (iview->image->surface.level[0].mode < RADEON_SURF_MODE_1D)
|
if (iview->image->surface.level[0].mode < RADEON_SURF_MODE_1D)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (memcmp(&iview->extent, &iview->image->extent, sizeof(iview->extent)))
|
if (!radv_image_extent_compare(iview->image, &iview->extent))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (clear_rect->rect.offset.x || clear_rect->rect.offset.y ||
|
if (clear_rect->rect.offset.x || clear_rect->rect.offset.y ||
|
||||||
|
|
|
||||||
|
|
@ -1284,6 +1284,15 @@ radv_sanitize_image_offset(const VkImageType imageType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
radv_image_extent_compare(const struct radv_image *image,
|
||||||
|
const VkExtent3D *extent)
|
||||||
|
{
|
||||||
|
if (memcmp(extent, &image->extent, sizeof(*extent)))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
struct radv_sampler {
|
struct radv_sampler {
|
||||||
uint32_t state[4];
|
uint32_t state[4];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue