Enables DCC/HTILE/CMASK/FMASK when supported, not just when we think
it is beneficial.
This is helpful to detect compression bugs with CTS.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6252>
validate the LLVM IR before LLVM compiles the shader
``errors``
display more info about errors
validate the LLVM IR before LLVM compiles the shader
``errors``
display more info about errors
+ ``forcecompress``
+ Enables DCC,FMASK,CMASK,HTILE in situations where the driver supports it
+ but normally does not deem it beneficial.
``info``
show GPU-related information
``metashaders``
``info``
show GPU-related information
``metashaders``
RADV_DEBUG_NO_MEMORY_CACHE = 1 << 25,
RADV_DEBUG_DISCARD_TO_DEMOTE = 1 << 26,
RADV_DEBUG_LLVM = 1 << 27,
RADV_DEBUG_NO_MEMORY_CACHE = 1 << 25,
RADV_DEBUG_DISCARD_TO_DEMOTE = 1 << 26,
RADV_DEBUG_LLVM = 1 << 27,
+ RADV_DEBUG_FORCE_COMPRESS = 1 << 28,
{"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
{"nomemorycache", RADV_DEBUG_NO_MEMORY_CACHE},
{"llvm", RADV_DEBUG_LLVM},
{"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
{"nomemorycache", RADV_DEBUG_NO_MEMORY_CACHE},
{"llvm", RADV_DEBUG_LLVM},
+ {"forcecompress", RADV_DEBUG_FORCE_COMPRESS},
-radv_image_use_fast_clear_for_image(const struct radv_image *image)
+radv_image_use_fast_clear_for_image(const struct radv_device *device,
+ const struct radv_image *image)
+ if (device->instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS)
+ return true;
+
if (image->info.samples <= 1 &&
image->info.width * image->info.height <= 512 * 512) {
/* Do not enable CMASK or DCC for small surfaces where the cost
if (image->info.samples <= 1 &&
image->info.width * image->info.height <= 512 * 512) {
/* Do not enable CMASK or DCC for small surfaces where the cost
vk_format_get_plane_count(format) > 1)
return false;
vk_format_get_plane_count(format) > 1)
return false;
- if (!radv_image_use_fast_clear_for_image(image))
+ if (!radv_image_use_fast_clear_for_image(device, image))
return false;
/* TODO: Enable DCC for mipmaps on GFX9+. */
return false;
/* TODO: Enable DCC for mipmaps on GFX9+. */
-radv_use_fmask_for_image(const struct radv_image *image)
+radv_use_fmask_for_image(const struct radv_device *device,
+ const struct radv_image *image)
{
return image->info.samples > 1 &&
{
return image->info.samples > 1 &&
- image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+ ((image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) ||
+ (device->instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS));
-radv_use_htile_for_image(const struct radv_image *image)
+radv_use_htile_for_image(const struct radv_device *device,
+ const struct radv_image *image)
{
return image->info.levels == 1 &&
{
return image->info.levels == 1 &&
- image->info.width * image->info.height >= 8 * 8;
+ ((image->info.width * image->info.height >= 8 * 8) ||
+ (device->instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS));
if (is_depth) {
surface->flags |= RADEON_SURF_ZBUFFER;
if (is_depth) {
surface->flags |= RADEON_SURF_ZBUFFER;
- if (!radv_use_htile_for_image(image) ||
+ if (!radv_use_htile_for_image(device, image) ||
(device->instance->debug_flags & RADV_DEBUG_NO_HIZ))
surface->flags |= RADEON_SURF_NO_HTILE;
if (radv_use_tc_compat_htile_for_image(device, pCreateInfo, image_format))
(device->instance->debug_flags & RADV_DEBUG_NO_HIZ))
surface->flags |= RADEON_SURF_NO_HTILE;
if (radv_use_tc_compat_htile_for_image(device, pCreateInfo, image_format))
if (!radv_use_dcc_for_image(device, image, pCreateInfo, image_format))
surface->flags |= RADEON_SURF_DISABLE_DCC;
if (!radv_use_dcc_for_image(device, image, pCreateInfo, image_format))
surface->flags |= RADEON_SURF_DISABLE_DCC;
- if (!radv_use_fmask_for_image(image))
+ if (!radv_use_fmask_for_image(device, image))
surface->flags |= RADEON_SURF_NO_FMASK;
return 0;
surface->flags |= RADEON_SURF_NO_FMASK;
return 0;
-radv_image_alloc_single_sample_cmask(const struct radv_image *image,
+radv_image_alloc_single_sample_cmask(const struct radv_device *device,
+ const struct radv_image *image,
struct radeon_surf *surf)
{
if (!surf->cmask_size || surf->cmask_offset || surf->bpe > 8 ||
image->info.levels > 1 || image->info.depth > 1 ||
struct radeon_surf *surf)
{
if (!surf->cmask_size || surf->cmask_offset || surf->bpe > 8 ||
image->info.levels > 1 || image->info.depth > 1 ||
- radv_image_has_dcc(image) || !radv_image_use_fast_clear_for_image(image))
+ radv_image_has_dcc(image) ||
+ !radv_image_use_fast_clear_for_image(device, image))
return;
assert(image->info.storage_samples == 1);
return;
assert(image->info.storage_samples == 1);
device->ws->surface_init(device->ws, &info, &image->planes[plane].surface);
if (!create_info.no_metadata_planes && image->plane_count == 1)
device->ws->surface_init(device->ws, &info, &image->planes[plane].surface);
if (!create_info.no_metadata_planes && image->plane_count == 1)
- radv_image_alloc_single_sample_cmask(image, &image->planes[plane].surface);
+ radv_image_alloc_single_sample_cmask(device, image, &image->planes[plane].surface);
image->planes[plane].offset = align(image->size, image->planes[plane].surface.alignment);
image->size = image->planes[plane].offset + image->planes[plane].surface.total_size;
image->planes[plane].offset = align(image->size, image->planes[plane].surface.alignment);
image->size = image->planes[plane].offset + image->planes[plane].surface.total_size;