diff --git a/docs/drivers/nvk.rst b/docs/drivers/nvk.rst index bc787724d1f..c28a8fc03ab 100644 --- a/docs/drivers/nvk.rst +++ b/docs/drivers/nvk.rst @@ -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 diff --git a/src/nouveau/vulkan/nvk_debug.h b/src/nouveau/vulkan/nvk_debug.h index e68f3d25e81..06ce357b48d 100644 --- a/src/nouveau/vulkan/nvk_debug.h +++ b/src/nouveau/vulkan/nvk_debug.h @@ -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 */ diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 809f50bd2f0..5f3c9ebe004 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -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; diff --git a/src/nouveau/vulkan/nvk_instance.c b/src/nouveau/vulkan/nvk_instance.c index 5a8464d0510..95550ab1985 100644 --- a/src/nouveau/vulkan/nvk_instance.c +++ b/src/nouveau/vulkan/nvk_instance.c @@ -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 }, };