mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 05:48:18 +02:00
radv: rename radv_image_use_dcc_image_stores()
To radv_image_compress_dcc_on_image_stores() because it seems more informative. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39803>
This commit is contained in:
parent
d58080f787
commit
02a2451e1f
5 changed files with 28 additions and 32 deletions
|
|
@ -252,7 +252,7 @@ radv_fixup_resolve_dst_metadata(struct radv_cmd_buffer *cmd_buffer, struct radv_
|
|||
return;
|
||||
|
||||
/* Nothing to do when compressed DCC writes are supported. */
|
||||
if (radv_image_use_dcc_image_stores(device, image))
|
||||
if (radv_image_compress_dcc_on_image_stores(device, image))
|
||||
return;
|
||||
|
||||
const bool is_partial_resolve = offset->x || offset->y || offset->z || extent->width != image->vk.extent.width ||
|
||||
|
|
|
|||
|
|
@ -14482,7 +14482,7 @@ radv_handle_color_image_transition(struct radv_cmd_buffer *cmd_buffer, struct ra
|
|||
|
||||
if (src_fmask_comp > dst_fmask_comp) {
|
||||
if (src_fmask_comp == RADV_FMASK_COMPRESSION_FULL) {
|
||||
if (radv_dcc_enabled(image, range->baseMipLevel) && !radv_image_use_dcc_image_stores(device, image)) {
|
||||
if (radv_dcc_enabled(image, range->baseMipLevel) && !radv_image_compress_dcc_on_image_stores(device, image)) {
|
||||
/* A DCC decompress is required before expanding FMASK when DCC stores aren't supported to
|
||||
* avoid being in a state where DCC is compressed and the main surface is uncompressed.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -166,12 +166,12 @@ radv_image_use_fast_clear_for_image(const struct radv_device *device, const stru
|
|||
if (instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS)
|
||||
return true;
|
||||
|
||||
return radv_image_use_fast_clear_for_image_early(device, image) && (image->exclusive ||
|
||||
/* Enable DCC for concurrent images if stores are
|
||||
* supported because that means we can keep DCC
|
||||
* compressed on all layouts/queues.
|
||||
*/
|
||||
radv_image_use_dcc_image_stores(device, image));
|
||||
return radv_image_use_fast_clear_for_image_early(device, image) &&
|
||||
(image->exclusive ||
|
||||
/* Enable DCC for concurrent images if stores are supported because that means we can
|
||||
* keep DCC compressed on all layouts/queues.
|
||||
*/
|
||||
radv_image_compress_dcc_on_image_stores(device, image));
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -329,30 +329,12 @@ radv_use_dcc_for_image_late(struct radv_device *device, struct radv_image *image
|
|||
|
||||
/* TODO: Fix storage images with DCC without DCC image stores.
|
||||
* Disabling it for now. */
|
||||
if ((image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT) && !radv_image_use_dcc_image_stores(device, image))
|
||||
if ((image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT) && !radv_image_compress_dcc_on_image_stores(device, image))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether to enable image stores with DCC compression for this image. If
|
||||
* this function returns false the image subresource should be decompressed
|
||||
* before using it with image stores.
|
||||
*
|
||||
* Note that this can have mixed performance implications, see
|
||||
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6796#note_643299
|
||||
*
|
||||
* This function assumes the image uses DCC compression.
|
||||
*/
|
||||
bool
|
||||
radv_image_use_dcc_image_stores(const struct radv_device *device, const struct radv_image *image)
|
||||
{
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
|
||||
return ac_surface_supports_dcc_image_stores(pdev->info.gfx_level, &image->planes[0].surface);
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether to use a predicate to determine whether DCC is in a compressed
|
||||
* state. This can be used to avoid decompressing an image multiple times.
|
||||
|
|
@ -360,7 +342,7 @@ radv_image_use_dcc_image_stores(const struct radv_device *device, const struct r
|
|||
bool
|
||||
radv_image_use_dcc_predication(const struct radv_device *device, const struct radv_image *image)
|
||||
{
|
||||
return radv_image_has_dcc(image) && !radv_image_use_dcc_image_stores(device, image);
|
||||
return radv_image_has_dcc(image) && !radv_image_compress_dcc_on_image_stores(device, image);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
|
@ -1707,7 +1689,7 @@ radv_layout_dcc_compressed(const struct radv_device *device, const struct radv_i
|
|||
|
||||
/* Don't compress compute transfer dst when image stores are not supported. */
|
||||
if ((layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL || layout == VK_IMAGE_LAYOUT_GENERAL) &&
|
||||
(queue_mask & (1u << RADV_QUEUE_COMPUTE)) && !radv_image_use_dcc_image_stores(device, image))
|
||||
(queue_mask & (1u << RADV_QUEUE_COMPUTE)) && !radv_image_compress_dcc_on_image_stores(device, image))
|
||||
return false;
|
||||
|
||||
/* Don't compress exclusive images used on transfer queues when SDMA doesn't support DCC.
|
||||
|
|
|
|||
|
|
@ -133,6 +133,22 @@ radv_dcc_enabled(const struct radv_image *image, unsigned level)
|
|||
return radv_image_has_dcc(image) && level < image->planes[0].surface.num_meta_levels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the image can compress DCC on image stores (GFX10+).
|
||||
*
|
||||
* Note that this can have mixed performance implications, see
|
||||
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6796#note_643299
|
||||
*
|
||||
* This function assumes the image uses DCC compression.
|
||||
*/
|
||||
static inline bool
|
||||
radv_image_compress_dcc_on_image_stores(const struct radv_device *device, const struct radv_image *image)
|
||||
{
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
|
||||
return ac_surface_supports_dcc_image_stores(pdev->info.gfx_level, &image->planes[0].surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the image has CB metadata.
|
||||
*/
|
||||
|
|
@ -371,8 +387,6 @@ radv_image_get_iterate256(const struct radv_device *device, struct radv_image *i
|
|||
bool radv_are_formats_dcc_compatible(const struct radv_physical_device *pdev, const void *pNext, VkFormat format,
|
||||
VkImageCreateFlags flags, bool *sign_reinterpret);
|
||||
|
||||
bool radv_image_use_dcc_image_stores(const struct radv_device *device, const struct radv_image *image);
|
||||
|
||||
bool radv_image_use_dcc_predication(const struct radv_device *device, const struct radv_image *image);
|
||||
|
||||
void radv_compose_swizzle(const struct util_format_description *desc, const VkComponentMapping *mapping,
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ radv_image_view_make_descriptor(struct radv_image_view *iview, struct radv_devic
|
|||
base_level_info = &plane->surface.u.legacy.level[force_zero_base_mip ? iview->vk.base_mip_level : 0];
|
||||
}
|
||||
|
||||
bool enable_write_compression = radv_image_use_dcc_image_stores(device, image);
|
||||
bool enable_write_compression = radv_image_compress_dcc_on_image_stores(device, image);
|
||||
bool decompress_htile_on_image_stores = radv_image_decompress_htile_on_image_stores(device, image);
|
||||
|
||||
if (is_storage_image && !(enable_write_compression || enable_compression || decompress_htile_on_image_stores))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue