From c51a0de3cf5b8b907aa02d2045bfd9ffe9132eb3 Mon Sep 17 00:00:00 2001 From: manon-traverse Date: Mon, 17 Aug 2026 10:50:46 +0200 Subject: [PATCH] vulkan(replay): don't hard-fail on optional device features the replay GPU lacks When replaying a capture on a slightly different driver than it was made on (e.g. an Android updatable/prerelease driver at capture time vs the system driver at replay), the replay physical device may not advertise an optional feature the capture had enabled, and replay aborted with APIHardwareUnsupported. Strip the unsupported feature from the replay device creation and warn instead, so the frame can still be replayed - it usually does not exercise the stripped feature. Co-Authored-By: Claude Opus 4.8 --- .../vulkan/wrappers/vk_device_funcs.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index c65982294c5..9040b060420 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -2299,14 +2299,20 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi VkPhysicalDeviceFeatures availFeatures = {0}; ObjDisp(physicalDevice)->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &availFeatures); -#define CHECK_PHYS_FEATURE(feature) \ - if(enabledFeatures.feature && !availFeatures.feature) \ - { \ - SET_ERROR_RESULT(m_FailedReplayResult, ResultCode::APIHardwareUnsupported, \ - "Capture requires physical device feature '" #feature \ - "' which is not supported\n\n%s", \ - GetPhysDeviceCompatString(false, false).c_str()); \ - return false; \ +// If the replay device lacks a feature the capture enabled, don't hard-fail: strip the feature +// from the device creation and warn. This handles captures made with a newer/updatable driver +// (e.g. Adreno gpudrivers) replayed against a slightly different driver that doesn't advertise +// the same optional features. The frame usually doesn't actually exercise the stripped feature. +#define CHECK_PHYS_FEATURE(feature) \ + if(enabledFeatures.feature && !availFeatures.feature) \ + { \ + RDCWARN("Capture enabled physical device feature '" #feature \ + "' not supported on the replay device - disabling it for replay."); \ + enabledFeatures.feature = VK_FALSE; \ + if(enabledFeatures2) \ + enabledFeatures2->features.feature = VK_FALSE; \ + if(createInfo.pEnabledFeatures) \ + ((VkPhysicalDeviceFeatures *)createInfo.pEnabledFeatures)->feature = VK_FALSE; \ } CHECK_PHYS_FEATURE(robustBufferAccess);