From 905e2e720d20fb23263f331a003d21abbb5c9a6c Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Tue, 10 Nov 2026 09:01:54 +0300 Subject: [PATCH] Turn dynamic alpha to coverage and dynamic vertex input off by default on Intel's Windows driver for integrated GPUs (#970, #992) UHD Graphics (i3-1215U, i3-1305U) and Iris Xe drew coloured noise on foliage with dynamic alpha to coverage and black patches over the scenery with dynamic vertex input; players confirmed that vk_dyn_a2c = 0 and vk_dyn_vertex = 0 clear both. vk_caps.intel_igpu_win marks Intel's proprietary Windows driver on an integrated GPU, and both defaults follow it. An explicit ini value still wins. Arc discrete GPUs and Mesa's ANV keep both on: no report there, and the ANV report (#989) had both off with its glitch still present. Co-Authored-By: Claude Opus 5.5 --- runtime/ui_text.c | 15 ++++++++++----- runtime/vk.h | 3 ++- runtime/vk_caps.c | 2 ++ runtime/vk_pipeline.c | 23 +++++++++++++++++------ totk.ini.example | 6 ++++-- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/runtime/ui_text.c b/runtime/ui_text.c index fd74a07f..5e24436f 100644 --- a/runtime/ui_text.c +++ b/runtime/ui_text.c @@ -440,7 +440,8 @@ static const char *const text_en[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "Forces dynamic vertex input on or off; the default depends on the GPU.", [UI_MENU_VK_DYN_A2C] = "Dynamic alpha to coverage", [UI_MENU_VK_DYN_A2C_DESC] = "Forces dynamic alpha to coverage on or off. Default: off on AMD's driver for RDNA 2 and " - "older, which draws characters black with it, on elsewhere.", + "older, which draws characters black with it, and on Intel's Windows driver for " + "integrated GPUs, which draws coloured noise on foliage; on elsewhere.", [UI_MENU_VK_SUBGROUP_PIN] = "Pin subgroup size", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "Fixes the shader subgroup size.", [UI_MENU_TRACE] = "Performance log", [UI_MENU_TRACE_DESC] = "Writes frame timings to a file.", [UI_MENU_FLIGHT] = "Flight recorder", @@ -919,8 +920,9 @@ static const char *const text_ru[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "Принудительно включает или выключает динамический ввод вершин; по умолчанию зависит от GPU.", [UI_MENU_VK_DYN_A2C] = "Динамический alpha to coverage", [UI_MENU_VK_DYN_A2C_DESC] = "Принудительно включает или выключает динамический alpha to coverage. По умолчанию " - "выключен на драйвере AMD для RDNA 2 и старше, где с ним персонажи чёрные, и включён " - "на остальных.", + "выключен на драйвере AMD для RDNA 2 и старше, где с ним персонажи чёрные, и на " + "драйвере Intel для Windows на встроенных GPU, где с ним цветной шум на листве; " + "включён на остальных.", [UI_MENU_VK_SUBGROUP_PIN] = "Фиксировать размер подгруппы", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "Фиксирует размер подгруппы шейдера.", [UI_MENU_TRACE] = "Журнал производительности", [UI_MENU_TRACE_DESC] = "Пишет время кадров в файл.", @@ -1297,7 +1299,9 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "Força a entrada dinâmica de vértices ligada ou desligada; o padrão depende da GPU.", [UI_MENU_VK_DYN_A2C] = "Alpha to coverage dinâmico", [UI_MENU_VK_DYN_A2C_DESC] = "Força o alpha to coverage dinâmico ligado ou desligado. Padrão: desligado no driver da AMD " - "para RDNA 2 e anteriores, que com ele desenha os personagens pretos, ligado nos demais.", + "para RDNA 2 e anteriores, que com ele desenha os personagens pretos, e no driver da " + "Intel para Windows em GPUs integradas, que desenha ruído colorido na folhagem; " + "ligado nos demais.", [UI_MENU_VK_SUBGROUP_PIN] = "Fixar tamanho do subgrupo", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "Fixa o tamanho do subgrupo dos shaders.", [UI_MENU_TRACE] = "Registro de desempenho", [UI_MENU_TRACE_DESC] = "Grava os tempos de quadro num arquivo.", @@ -1930,7 +1934,8 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "强制开关动态顶点输入;默认值取决于显卡。", [UI_MENU_VK_DYN_A2C] = "动态 Alpha 覆盖", [UI_MENU_VK_DYN_A2C_DESC] = "强制开关动态 Alpha 覆盖。默认:AMD RDNA 2 及更早的驱动上为关闭," - "开启会导致人物变黑;其他显卡上为开启。", + "开启会导致人物变黑;Intel 集成显卡的 Windows 驱动上也为关闭,开启会使植被出现彩色噪点;" + "其他显卡上为开启。", [UI_MENU_VK_SUBGROUP_PIN] = "固定子群大小", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "固定着色器的子群大小。", [UI_MENU_TRACE] = "性能日志", diff --git a/runtime/vk.h b/runtime/vk.h index ee50f2cd..523cc6da 100644 --- a/runtime/vk.h +++ b/runtime/vk.h @@ -59,9 +59,10 @@ typedef struct { int amd; // an AMD GPU (vendor 0x1002), any driver int amd_sc; // AMD's Windows driver branch for RDNA 1 and 2 ("AMD proprietary shader compiler") int mesa; // a Mesa driver the game runs on: RADV, ANV or NVK + int intel_igpu_win; // Intel's Windows driver on an integrated GPU (UHD, Iris Xe, Core Ultra graphics) } VkCaps; extern VkCaps vk_caps; -void vk_caps_driver(VkPhysicalDevice p); // first, before vkCreateDevice: vk_caps.amd, amd_sc, mesa +void vk_caps_driver(VkPhysicalDevice p); // first, before vkCreateDevice: vk_caps.amd, amd_sc, mesa, intel_igpu_win void vk_caps_features(VkPhysicalDeviceFeatures *f); // before vkCreateDevice (TOTK_VK_NO_FLOAT64 clears shaderFloat64) // Before vkCreateDevice, with the driver's graphics pipeline library feature and properties: sets vk_caps.gpl, // 1 = enable the extensions (VK_KHR_pipeline_library, VK_EXT_graphics_pipeline_library) and the feature. diff --git a/runtime/vk_caps.c b/runtime/vk_caps.c index 17fe85d3..bc99712e 100644 --- a/runtime/vk_caps.c +++ b/runtime/vk_caps.c @@ -45,6 +45,8 @@ void vk_caps_driver(VkPhysicalDevice p) { vk_caps.amd_sc = drv.driverID == VK_DRIVER_ID_AMD_PROPRIETARY && strstr(drv.driverInfo, "shader compiler"); vk_caps.mesa = drv.driverID == VK_DRIVER_ID_MESA_RADV || drv.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA || drv.driverID == VK_DRIVER_ID_MESA_NVK; + vk_caps.intel_igpu_win = drv.driverID == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS && + p2.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; } // TOTK_GPL=0 turns graphics pipeline libraries off; they are on wherever the driver has fast linking. AMD's RDNA 1/2 diff --git a/runtime/vk_pipeline.c b/runtime/vk_pipeline.c index 21aa2de9..19e71d23 100644 --- a/runtime/vk_pipeline.c +++ b/runtime/vk_pipeline.c @@ -266,13 +266,19 @@ static int ensure_init(void) { } // TOTK_VK_DYN_VERTEX=0/1 forces dynamic vertex input off or on. Default off on Intel's frozen Windows driver for its // older integrated GPUs (UHD 630, Ice Lake: Vulkan 1.3.215 and older), which draws nothing with it; LAS Recomp - // turns it off there for the same reason. + // turns it off there for the same reason. Also off on Intel's current Windows driver for its integrated GPUs + // (vk_caps.intel_igpu_win): on UHD Graphics (i3-1215U, 101.6129; i3-1305U, 101.7088) and Iris Xe (101.7092) it + // drew black rectangles over walls, trees and floating islands, and vk_dyn_vertex = 0 removed them (issues #970, + // #992, #81). Mesa's ANV on the same GPUs keeps it: a report there (#989) had both switches off and its glitch stayed. const char *dv = cfg_get("TOTK_VK_DYN_VERTEX"); // no fixed default: it depends on the GPU, see above int intel_legacy = c->props.vendorID == 0x8086 && c->props.apiVersion <= VK_MAKE_API_VERSION(0, 1, 3, 215); - int dv_on = dv && *dv ? strcmp(dv, "0") != 0 : !intel_legacy; + int dv_on = dv && *dv ? strcmp(dv, "0") != 0 : !intel_legacy && !vk_caps.intel_igpu_win; P.dyn_vi = dv_on && c->has_vertex_input_dynamic_state && PROC(set_vi, "vkCmdSetVertexInputEXT"); if (!dv_on && c->has_vertex_input_dynamic_state) - rt_log("vk_pipeline: dynamic vertex input off (%s)", dv && *dv ? "TOTK_VK_DYN_VERTEX=0" : "Intel's older Windows driver draws nothing with it"); + rt_log("vk_pipeline: dynamic vertex input off (%s)", + dv && *dv ? "TOTK_VK_DYN_VERTEX=0" + : intel_legacy ? "Intel's older Windows driver draws nothing with it" + : "Intel's Windows driver for integrated GPUs draws black patches with it"); if (c->has_eds3) { P.dyn_clamp = e3.extendedDynamicState3DepthClampEnable && P.f_depth_clamp && PROC(set_clamp, "vkCmdSetDepthClampEnableEXT"); P.dyn_poly = e3.extendedDynamicState3PolygonMode && PROC(set_poly, "vkCmdSetPolygonModeEXT"); @@ -285,12 +291,17 @@ static int ensure_init(void) { // RDNA 2 and older (vk_caps.amd_sc), which applies alpha to coverage while the dynamic state says off: on an RX 590 // (24.9.1) TotK, which never turns it on, drew Link and the NPCs with depth but no colour (black silhouettes) and // dithered other surfaces into checkerboards (issue #67, RX 470/570/580). Taken out of the dynamic state, it goes - // into the pipeline key and the characters draw. + // into the pipeline key and the characters draw. Also off on Intel's Windows driver for its integrated GPUs + // (vk_caps.intel_igpu_win): UHD Graphics and Iris Xe drew coloured noise on branches, foliage and wood with it, and + // vk_dyn_a2c = 0 removed it (issues #970, #992, #419). const char *da = cfg_get("TOTK_VK_DYN_A2C"); // no fixed default: it depends on the driver, see above - int da_on = da && *da ? strcmp(da, "0") != 0 : !vk_caps.amd_sc; + int da_on = da && *da ? strcmp(da, "0") != 0 : !vk_caps.amd_sc && !vk_caps.intel_igpu_win; if (!da_on && P.dyn_a2c) { P.dyn_a2c = 0; - rt_log("vk_pipeline: dynamic alpha to coverage off (%s)", da && *da ? "TOTK_VK_DYN_A2C=0" : "AMD's driver for RDNA 2 and older"); + rt_log("vk_pipeline: dynamic alpha to coverage off (%s)", + da && *da ? "TOTK_VK_DYN_A2C=0" + : vk_caps.amd_sc ? "AMD's driver for RDNA 2 and older" + : "Intel's Windows driver for integrated GPUs draws coloured noise with it"); } #undef PROC static const VkDynamicState core[] = { diff --git a/totk.ini.example b/totk.ini.example index a8412a87..c12fc1b6 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -116,10 +116,12 @@ # vk_validation = 0 # A thread of its own makes the Vulkan calls of each frame, 0 or 1. Default: on, except on AMD GPUs. # vk_recorder = 1 -# Dynamic vertex input, 0 or 1. Default: on, except on Intel's older integrated GPU drivers (Vulkan 1.3.215 and older). +# Dynamic vertex input, 0 or 1. Default: on, except on Intel's Windows driver for integrated GPUs (UHD, Iris Xe), +# which draws black patches with it. # vk_dyn_vertex = 1 # Dynamic alpha to coverage, 0 or 1. Default: on, except on AMD's driver for RDNA 2 and older (RX 400 to RX 6000), -# which applies alpha to coverage while the dynamic state says off and draws the characters black. +# which applies alpha to coverage while the dynamic state says off and draws the characters black, and on Intel's +# Windows driver for integrated GPUs (UHD, Iris Xe), which draws coloured noise on foliage with it. # vk_dyn_a2c = 1 # Pin the shader subgroup size to 32 when the GPU allows it. # vk_subgroup_pin = 1