nvk: Add an NVK_DEBUG=no_compression flag

This commit is contained in:
Faith Ekstrand 2026-05-06 11:35:28 -04:00
parent 782dfb09f0
commit 52afa936b2
4 changed files with 9 additions and 0 deletions

View file

@ -76,6 +76,8 @@ specific to NVK:
``coherent``
Forces all memory maps to be coherent with the CPU caches. This only
applies to Tegra devices.
``no_compression``
Disables image compression.
.. envvar:: NVK_I_WANT_A_BROKEN_VULKAN_DRIVER

View file

@ -42,6 +42,9 @@ enum nvk_debug {
/* Force all memory allocations to go to GART */
NVK_DEBUG_FORCE_COHERENT = 1ull << 8,
/* Disable image compression */
NVK_DEBUG_NO_COMPRESSION = 1ull << 9,
};
#endif /* NVK_DEBUG_H */

View file

@ -776,6 +776,9 @@ static bool
nvk_image_can_compress(const struct nvk_physical_device *pdev,
const struct nvk_image *image)
{
if (pdev->debug_flags & NVK_DEBUG_NO_COMPRESSION)
return false;
if (!pdev->nvkmd->kmd_info.has_compression)
return false;

View file

@ -91,6 +91,7 @@ nvk_init_debug_flags(struct nvk_instance *instance)
{ "edb_bview", NVK_DEBUG_FORCE_EDB_BVIEW },
{ "gart", NVK_DEBUG_FORCE_GART },
{ "coherent", NVK_DEBUG_FORCE_COHERENT },
{ "no_compression", NVK_DEBUG_NO_COMPRESSION },
{ NULL, 0 },
};