From 681cd27fd50ae62c36773c22e1622e87e52bd535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=AE=2E=20=D0=94?= =?UTF-8?q?=D0=B8=D0=BD=D0=B4=D0=B8=D0=BA=D0=BE=D0=B2?= Date: Fri, 10 Jul 2026 15:46:43 +0300 Subject: [PATCH] enable DXIL compilation for DX12 backend --- gui_windows.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gui_windows.go b/gui_windows.go index a8e8968..0918889 100644 --- a/gui_windows.go +++ b/gui_windows.go @@ -3,6 +3,7 @@ package main import ( + "os" "strings" "github.com/unxed/vtui" @@ -12,6 +13,14 @@ func RunGui(backend string) error { if backend == "qt" || strings.HasPrefix(backend, "ext:") { return RunExternalUIWithMapping(backend) } + // DX12: use naga DXIL backend instead of HLSL→FXC + // to avoid 2-6s shader compilation via d3dcompiler_47.dll + if os.Getenv("GOGPU_DX12_DXIL") == "" { + api := os.Getenv("GOGPU_GRAPHICS_API") + if api == "" || strings.EqualFold(api, "dx12") || strings.EqualFold(api, "d3d12") || strings.EqualFold(api, "directx") { + os.Setenv("GOGPU_DX12_DXIL", "1") + } + } return vtui.RunInGUIWindow(100, 30, backend, func() { SetupUI() })