mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 23:40:10 +01:00
anv: rename compressed format emulation helpers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32676>
This commit is contained in:
parent
ce7208c3ee
commit
eda9422cfc
5 changed files with 14 additions and 11 deletions
|
|
@ -571,7 +571,7 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device
|
|||
assert((isl_mod_info != NULL) ==
|
||||
(vk_tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT));
|
||||
|
||||
if (anv_is_format_emulated(physical_device, vk_format)) {
|
||||
if (anv_is_compressed_format_emulated(physical_device, vk_format)) {
|
||||
assert(isl_format_is_compressed(anv_format->planes[0].isl_format));
|
||||
|
||||
/* require optimal tiling so that we can decompress on upload */
|
||||
|
|
@ -1523,7 +1523,7 @@ anv_get_image_format_properties(
|
|||
/* We don't want emulated formats to gain unexpected usage (storage in
|
||||
* particular) from its compatible view formats.
|
||||
*/
|
||||
if (anv_is_format_emulated(physical_device, info->format))
|
||||
if (anv_is_compressed_format_emulated(physical_device, info->format))
|
||||
goto unsupported;
|
||||
|
||||
/* From the Vulkan 1.3.224 spec "43.1.6. Format Compatibility Classes":
|
||||
|
|
|
|||
|
|
@ -1688,13 +1688,13 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
|||
image->disjoint = image->n_planes > 1 &&
|
||||
(pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT);
|
||||
|
||||
if (anv_is_format_emulated(device->physical, pCreateInfo->format)) {
|
||||
if (anv_is_compressed_format_emulated(device->physical, pCreateInfo->format)) {
|
||||
assert(image->n_planes == 1 &&
|
||||
vk_format_is_compressed(image->vk.format));
|
||||
assert(!(image->vk.create_flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT));
|
||||
|
||||
image->emu_plane_format =
|
||||
anv_get_emulation_format(device->physical, image->vk.format);
|
||||
image->emu_plane_format = anv_get_compressed_format_emulation(
|
||||
device->physical, image->vk.format);
|
||||
|
||||
/* for fetching the raw copmressed data and storing the decompressed
|
||||
* data
|
||||
|
|
|
|||
|
|
@ -265,10 +265,10 @@ anv_image_view_init(struct anv_device *device,
|
|||
anv_aspect_to_plane(iview->vk.aspects, 1UL << iaspect_bit);
|
||||
|
||||
VkFormat view_format = iview->vk.view_format;
|
||||
if (anv_is_format_emulated(device->physical, view_format)) {
|
||||
if (anv_is_compressed_format_emulated(device->physical, view_format)) {
|
||||
assert(image->emu_plane_format != VK_FORMAT_UNDEFINED);
|
||||
view_format =
|
||||
anv_get_emulation_format(device->physical, view_format);
|
||||
anv_get_compressed_format_emulation(device->physical, view_format);
|
||||
}
|
||||
const struct anv_format_plane format = anv_get_format_plane(
|
||||
device->physical, view_format, vplane, image->vk.tiling);
|
||||
|
|
|
|||
|
|
@ -5323,7 +5323,8 @@ extern VkFormat
|
|||
vk_format_from_android(unsigned android_format, unsigned android_usage);
|
||||
|
||||
static inline VkFormat
|
||||
anv_get_emulation_format(const struct anv_physical_device *pdevice, VkFormat format)
|
||||
anv_get_compressed_format_emulation(const struct anv_physical_device *pdevice,
|
||||
VkFormat format)
|
||||
{
|
||||
if (pdevice->flush_astc_ldr_void_extent_denorms) {
|
||||
const struct util_format_description *desc =
|
||||
|
|
@ -5340,9 +5341,11 @@ anv_get_emulation_format(const struct anv_physical_device *pdevice, VkFormat for
|
|||
}
|
||||
|
||||
static inline bool
|
||||
anv_is_format_emulated(const struct anv_physical_device *pdevice, VkFormat format)
|
||||
anv_is_compressed_format_emulated(const struct anv_physical_device *pdevice,
|
||||
VkFormat format)
|
||||
{
|
||||
return anv_get_emulation_format(pdevice, format) != VK_FORMAT_UNDEFINED;
|
||||
return anv_get_compressed_format_emulation(pdevice,
|
||||
format) != VK_FORMAT_UNDEFINED;
|
||||
}
|
||||
|
||||
static inline struct isl_swizzle
|
||||
|
|
|
|||
|
|
@ -1526,7 +1526,7 @@ anv_sparse_image_check_support(struct anv_physical_device *pdevice,
|
|||
* formats due to the additional image plane. It would make the
|
||||
* implementation extremely complicated.
|
||||
*/
|
||||
if (anv_is_format_emulated(pdevice, vk_format))
|
||||
if (anv_is_compressed_format_emulated(pdevice, vk_format))
|
||||
return VK_ERROR_FORMAT_NOT_SUPPORTED;
|
||||
|
||||
/* While the spec itself says linear is not supported (see above), deqp-vk
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue