tu: Enable UBWC for storage images on a7xx

I'm not sure exactly when this was introduced. It doesn't work on a650,
but does work on a7xx, I'm not sure whether it works on the a660
generation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506>
This commit is contained in:
Connor Abbott 2024-02-07 06:42:32 -05:00
parent b9e04f8293
commit a80a23dc49
3 changed files with 15 additions and 15 deletions

View file

@ -172,6 +172,12 @@ struct fd_dev_info {
bool broken_ds_ubwc_quirk;
/* Whether UBWC is supported on all IBOs. Prior to this, only readonly
* or writeonly IBOs could use UBWC and mixing reads and writes was not
* permitted.
*/
bool supports_ibo_ubwc;
struct {
uint32_t PC_POWER_CNTL;
uint32_t TPL1_DBG_ECO_CNTL;

View file

@ -779,6 +779,7 @@ a7xx_base = A6XXProps(
enable_lrz_fast_clear = True,
has_lrz_dir_tracking = True,
has_per_view_viewport = True,
supports_ibo_ubwc = True,
)
a7xx_725 = A7XXProps(

View file

@ -331,22 +331,15 @@ ubwc_possible(struct tu_device *device,
return false;
}
/* Disable UBWC for storage images.
/* Disable UBWC for storage images when not supported.
*
* The closed GL driver skips UBWC for storage images (and additionally
* uses linear for writeonly images). We seem to have image tiling working
* in freedreno in general, so turnip matches that. freedreno also enables
* UBWC on images, but it's not really tested due to the lack of
* UBWC-enabled mipmaps in freedreno currently. Just match the closed GL
* behavior of no UBWC.
*/
if ((usage | stencil_usage) & VK_IMAGE_USAGE_STORAGE_BIT) {
if (device) {
perf_debug(device,
"Disabling UBWC for %s storage image, but should be "
"possible to support",
util_format_name(vk_format_to_pipe_format(format)));
}
* Prior to a7xx, storage images must be readonly or writeonly to use UBWC.
* Freedreno can determine when this isn't the case and decompress the
* image on-the-fly, but we don't know which image a binding corresponds to
* and we can't change the descriptor so we can't do this.
*/
if (((usage | stencil_usage) & VK_IMAGE_USAGE_STORAGE_BIT) &&
!info->a6xx.supports_ibo_ubwc) {
return false;
}