diff --git a/runtime/cfg.c b/runtime/cfg.c index 53f2bb98..c53dfa49 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -151,7 +151,7 @@ static const CfgMeta metas[] = { // shaders and pipelines {"PIPE_WAIT", "default", "default|draw", RESTART}, {"PIPE_SKIP", "fullscreen", "strict|any|fullscreen", RESTART}, {"LIB_PREBUILD", "1", "0|1", RESTART}, {"LIB_PREBUILD_THREADS", "", "1..64", RESTART}, - {"PIPE_PREBUILD", "1", "0|1", RESTART}, {"PREWARM_XLATE", "", "1..64", RESTART}, {"GPL", "", "0|1", RESTART}, + {"PIPE_PREBUILD", "1", "0|1", RESTART}, {"PREWARM_XLATE", "", "1..64", RESTART}, {"GPL", "1", "0|1", RESTART}, // textures and memory {"ASTC", "auto", "auto|gpu|native|cpu", RESTART}, {"MEMORY", "auto", "auto|import|mirror|verify", RESTART}, {"TEX_ALIAS", "1", "0|1", RESTART}, {"TEX_VRAM_PRESSURE", "90", "0..100", RESTART}, {"ASTC_BC", "0", "0|1", RESTART}, {"ZSTD_NATIVE", "1", "0|1", RESTART}, {"ZSTD_CHECK", "0", "0|1", RESTART}, diff --git a/runtime/vk_caps.c b/runtime/vk_caps.c index 43d00b0c..0c3a86d8 100644 --- a/runtime/vk_caps.c +++ b/runtime/vk_caps.c @@ -6,8 +6,7 @@ // - minStorageBufferOffsetAlignment above 4 (TOTK_VK_SSBO_ALIGN= raises it): the translator computes // storage offsets from the guest address rounded down to that alignment (Ryujinx's unaligned storage path), and // vk_exec_draw.c ssbo_info binds the rounded-down address, so shader writes reach guest memory instead of a copy. -// - no graphics pipeline library with fast linking (TOTK_GPL=0 forces it; the default on AMD's RDNA 1/2 driver): -// vk_caps.gpl = 0, the extension stays disabled, and pipelines are built whole. +// - no graphics pipeline library with fast linking (TOTK_GPL=0 forces it): vk_caps.gpl = 0, the extension stays disabled, and pipelines are built whole. // - no 32-lane pin (no subgroupSizeControl, 32 outside min..max, or TOTK_VK_SUBGROUP_PIN=0): stages run at the // device's subgroupSize (SPIR-V 1.3 without a required size) and the translator is told that size. // TOTK_VK_SUBGROUP= pins n instead of 32 where the driver allows it. @@ -46,15 +45,18 @@ void vk_caps_driver(VkPhysicalDevice p) { vk_caps.amd_sc = drv.driverID == VK_DRIVER_ID_AMD_PROPRIETARY && strstr(drv.driverInfo, "shader compiler"); } -// TOTK_GPL=0/1 forces graphics pipeline libraries off or on. Default off on AMD's RDNA 1/2 driver branch: every boot -// that lost the device there had a cold pipeline cache and draws waiting on fast-linked pipelines, and a run with GPL -// off booted (issue #5); Savage Wind Recomp turns GPL off on RDNA 4 under RADV for a GPU hang at the title screen. +// TOTK_GPL=0 turns graphics pipeline libraries off; they are on wherever the driver has fast linking. AMD's RDNA 1/2 +// driver branch had them off for a while: its device losses at boot (issue #5) came with a cold pipeline cache, but +// their cause was GPU writes past 3D BC images (vk_exec.c, "3D BC render targets"). With that fixed, the RDNA 1/2 +// driver boots with GPL from a cold cache and fast-links without a failure, while with GPL off every new pipeline is +// built whole on the draw's path (frames of 0.5-1.2 s on an RX 6600, issue #381). Savage Wind Recomp turns GPL off on +// RDNA 4 under RADV for a GPU hang at the title screen. int vk_caps_gpl(const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *f, const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *p) { gpl_lib = f->graphicsPipelineLibrary; gpl_fast = p->graphicsPipelineLibraryFastLinking; - const char *e = cfg_get("TOTK_GPL"); // no fixed default: it depends on the driver, see above - vk_caps.gpl = gpl_lib && gpl_fast && (e && *e ? strcmp(e, "0") != 0 : !vk_caps.amd_sc); + const char *e = cfg_get("TOTK_GPL"); + vk_caps.gpl = gpl_lib && gpl_fast && !(e && !strcmp(e, "0")); return vk_caps.gpl; } @@ -137,10 +139,8 @@ void vk_caps_init(VkCtx *c) { has_ext(ep, ne, "VK_EXT_graphics_pipeline_library"), depth_ok(p, VK_FORMAT_D16_UNORM), depth_ok(p, VK_FORMAT_D24_UNORM_S8_UINT), depth_ok(p, VK_FORMAT_X8_D24_UNORM_PACK32), depth_ok(p, VK_FORMAT_D32_SFLOAT), depth_ok(p, VK_FORMAT_D32_SFLOAT_S8_UINT)); - const char *ge = cfg_get("TOTK_GPL"); rt_log("vk caps: gpl %s fast-link %s (graphicsPipelineLibrary %u%s)", vk_caps.gpl ? "yes" : "no", - gpl_fast ? "yes" : "no", (unsigned)gpl_lib, - !gpl_lib || !gpl_fast || vk_caps.gpl ? "" : ge && *ge ? ", off by TOTK_GPL=0" : ", off on AMD's RDNA 1/2 driver"); + gpl_fast ? "yes" : "no", (unsigned)gpl_lib, !gpl_lib || !gpl_fast || vk_caps.gpl ? "" : ", off by TOTK_GPL=0"); rt_log("vk caps: fallbacks: float64 %s, storage buffers %s %u, subgroup pin %u on stages %#x, translator subgroup vs/fs/cs %u/%u/%u", vk_caps.float64 ? "native" : "softfloat64", vk_caps.sbuf_align ? "rounded down to" : "exact, alignment", (unsigned)l->minStorageBufferOffsetAlignment, want, (unsigned)vk_caps.sg_pin_stages, told[0], told[1], told[2]); diff --git a/totk.ini.example b/totk.ini.example index e22dbbee..e209a61f 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -55,7 +55,7 @@ # pipe_prebuild = 1 # Threads that translate known shaders at start (1 to 64; default: half the CPU threads, at most 16). # prewarm_xlate = 8 -# Vulkan graphics pipeline library, 0 or 1. Default: on, except on AMD's driver for RDNA 1 and 2 (RX 5000 and 6000). +# Vulkan graphics pipeline library, 0 or 1. Default: on. # gpl = 1 # Textures and memory.