aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_device.h
diff options
context:
space:
mode:
authorkraibse <33869366+kraibse@users.noreply.github.com>2026-11-01 17:21:27 +0100
committerkraibse <33869366+kraibse@users.noreply.github.com>2026-11-01 17:29:56 +0100
commit6bde8c20d1f7c020a920e59a989c03822a08445d (patch)
tree2c5fff7f9e284a9b15383bfc828b06d563ae50c9 /src/video_core/vulkan_common/vulkan_device.h
parent3d6156434a96c75e30fc4cfa65409fb2800d737a (diff)
vulkan: treat RADV like the other AMD drivers for unbound sparse images
Add EDEN_NX2_SPARSE_UNBACKED=0/1 to force unbound sparse images off or on on any driver, so Linux AMD testers can check whether RADV needs this.
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.h')
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index 3d2408fc35..8237868c6d 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -7,6 +7,7 @@
#pragma once
#include <atomic>
+#include <cstdlib>
#include <optional>
#include <set>
#include <span>
@@ -333,10 +334,19 @@ public:
/// Whether images with no memory bound may be sampled and used as attachments. AMD's drivers
/// fault on it (the GPU hangs shortly after the first such draw), so large images there are
- /// backed normally.
+ /// backed normally. RADV is counted in until someone shows it doesn't need it.
+ /// EDEN_NX2_SPARSE_UNBACKED=1 allows unbound images on any driver, =0 on none.
bool CanUseUnbackedSparseImages() const {
+ static const char forced = [] {
+ const char* value = std::getenv("EDEN_NX2_SPARSE_UNBACKED");
+ return value == nullptr ? '\0' : value[0];
+ }();
+ if (forced == '0' || forced == '1') {
+ return forced == '1';
+ }
const VkDriverIdKHR id = GetDriverID();
- return id != VK_DRIVER_ID_AMD_PROPRIETARY && id != VK_DRIVER_ID_AMD_OPEN_SOURCE;
+ return id != VK_DRIVER_ID_AMD_PROPRIETARY && id != VK_DRIVER_ID_AMD_OPEN_SOURCE &&
+ id != VK_DRIVER_ID_MESA_RADV;
}
/// Returns true for tile-based deferred renderers.