From b8dc585958322d17c069c7d447c95e52692973b2 Mon Sep 17 00:00:00 2001 From: butilly Date: Sat, 31 Oct 2026 13:24:43 +0000 Subject: [PATCH 1/2] Isaac: self-enabling wrapper diagnostics for OpenGL RGB flicker --- src/vulkan/wrapper/wrapper_device.c | 6 ++++++ src/vulkan/wrapper/wrapper_log.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/vulkan/wrapper/wrapper_device.c b/src/vulkan/wrapper/wrapper_device.c index 2602532d383..9afa8fc7529 100644 --- a/src/vulkan/wrapper/wrapper_device.c +++ b/src/vulkan/wrapper/wrapper_device.c @@ -1230,6 +1230,12 @@ wrapper_emit_diag(struct wrapper_physical_device *pdev, D("engine: '%s' -> detected %s (app '%s')\n", eng, detected, pdev->instance->vk.app_info.app_name ? pdev->instance->vk.app_info.app_name : ""); D("--- native capabilities (what THIS device actually has) ---\n"); + D(" fillModeNonSolid : native=%d advertised=%d\n", + pdev->base_supported_features.fillModeNonSolid, + pdev->vk.supported_features.fillModeNonSolid); + D(" shaderClipDistance : native=%d advertised=%d\n", + pdev->base_supported_features.shaderClipDistance, + pdev->vk.supported_features.shaderClipDistance); D(" textureCompressionBC : %d\n", pdev->base_supported_features.textureCompressionBC); D(" textureCompressionASTC_LDR : %d\n", pdev->base_supported_features.textureCompressionASTC_LDR); D(" robustBufferAccess2 : %d\n", pdev->base_supported_features.robustBufferAccess2); diff --git a/src/vulkan/wrapper/wrapper_log.c b/src/vulkan/wrapper/wrapper_log.c index a2af67a5a2f..154bc8f6cad 100644 --- a/src/vulkan/wrapper/wrapper_log.c +++ b/src/vulkan/wrapper/wrapper_log.c @@ -136,6 +136,13 @@ void write_to_logfile(const char *fmt, const char *level, ...) { void init_wrapper_logging() { + /* Diagnostic package: keep the existing capability/format/copy probes on + * even when the launcher does not pass the guest diagnostic environment + * through to the native OpenGL/Zink driver process. */ + setenv("WRAPPER_DIAG", "1", 1); + fprintf(stderr, "[WRAPPER_DIAG] isaac-wrapper-diagnostic-1 loaded; automatic capability/format/copy capture enabled\n"); + fflush(stderr); + char *wrapper_log_level_env = getenv("WRAPPER_LOG_LEVEL"); parse_wrapper_debug_str(wrapper_log_level_env); From c1047c45bd1fd299fc3a5d381c8b1383e8bba695 Mon Sep 17 00:00:00 2001 From: butilly Date: Sun, 1 Nov 2026 02:35:24 +0000 Subject: [PATCH 2/2] Wrapper: test Zink discard fallback on Mali-G925 --- src/vulkan/wrapper/wrapper_physical_device.c | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/vulkan/wrapper/wrapper_physical_device.c b/src/vulkan/wrapper/wrapper_physical_device.c index 3b1d7c34a11..f2ddc5ab9df 100644 --- a/src/vulkan/wrapper/wrapper_physical_device.c +++ b/src/vulkan/wrapper/wrapper_physical_device.c @@ -16,6 +16,27 @@ #include "util/os_misc.h" #include "util/u_debug.h" +static bool +wrapper_zink_discard_workaround(const struct wrapper_physical_device *pdevice) +{ + const char *engine = pdevice->instance->vk.app_info.engine_name; + return engine && !strcmp(engine, "mesa zink") && + pdevice->driver_properties.driverID == VK_DRIVER_ID_ARM_PROPRIETARY && + pdevice->properties2.properties.deviceID == 0xd8300010; +} + +static void +wrapper_zink_discard_cache_uuid(const struct wrapper_physical_device *pdevice, + VkPhysicalDeviceProperties *properties) +{ + /* Zink keys both its NIR/SPIR-V and pipeline disk caches with this UUID. + * Separate the discard variant from shaders compiled with demote enabled. + * Native pipeline cache blobs still pass through to the same base driver. + */ + if (wrapper_zink_discard_workaround(pdevice)) + properties->pipelineCacheUUID[0] ^= 0xd1; +} + static uint32_t parse_vk_version_from_env_named(const char *name) { @@ -438,6 +459,17 @@ VkResult enumerate_physical_device(struct vk_instance *_instance) const uint32_t engine_version = instance->vk.app_info.engine_version; const uint32_t driver_version = pdevice->properties2.properties.driverVersion; + /* Comparison build for RGB flicker with Zink fragment discard on G925. + * Mask the feature as well as the extension: it is promoted in Vulkan + * 1.3, so hiding only the extension can leave the core path available. + * Keep base capabilities intact; Zink generates the fallback itself. + */ + if (wrapper_zink_discard_workaround(pdevice)) { + pdevice->vk.supported_extensions.EXT_shader_demote_to_helper_invocation = false; + supported_features->shaderDemoteToHelperInvocation = false; + WRAPPER_LOG(info, "Zink discard comparison: demote extension and core feature hidden; separate shader cache"); + } + /* DXVK forces hostQueryReset on from D3D_FEATURE_LEVEL_9_1 up, so a driver * without it gets no D3D11 device at any level. Gated on the driver * rather than on the engine name: the base-lacks guard already limits @@ -767,6 +799,7 @@ wrapper_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VK_FROM_HANDLE(wrapper_physical_device, pdevice, physicalDevice); pdevice->dispatch_table.GetPhysicalDeviceProperties( pdevice->dispatch_handle, pProperties); + wrapper_zink_discard_cache_uuid(pdevice, pProperties); uint32_t api_version = wrapper_effective_api_version(pdevice, pProperties->apiVersion); @@ -850,6 +883,7 @@ wrapper_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VK_FROM_HANDLE(wrapper_physical_device, pdevice, physicalDevice); pdevice->dispatch_table.GetPhysicalDeviceProperties2( pdevice->dispatch_handle, pProperties); + wrapper_zink_discard_cache_uuid(pdevice, &pProperties->properties); uint32_t api_version = wrapper_effective_api_version( pdevice, pProperties->properties.apiVersion);