Custom MESA & SwiftShader Windows drivers

Started by Stefan, May 23, 2024, 07:35:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stefan

Download via Github

All credits go to the authors of the source codes - "I'm just a cook"
Many thanks to mmozeiko, whose build.cmd i have heavily modified over time
Drivers are built against latest Vulkan headers & MESA & SwiftShader & LLVM commits



Create a system restore point before before trying ANY new software!

On legacy systems without offical Vulkan support install the Vulkan loader from Lunar at first

Never ever copy opengl32.dll into the Windows system folders!
I wrote some batch files that can be used inside a program folder, paths need to be aligned.
If you prefer "set" to "setx /m", then edit that as well

Settings for zink on LLVMPIPE/SwiftShader/WARP
  • setx /m GALLIUM_DRIVER zink
  • setx /m LIBGL_ALWAYS_SOFTWARE true
  • setx /m MESA_GL_VERSION_OVERRIDE 4.6
  • setx /m MESA_GLSL_VERSION_OVERRIDE 460
  • setx /m MESA_GLES_VERSION_OVERRIDE 3.2
  • setx /m VK_DRIVER_FILES path\to\whatever.json

Don't install LAVA drivers under [HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers]
DZN and SwiftShader are OK there

If you are missing dxil.dll, then get it from here

Terakan - fork for AMD Terascale discrete GPUs
 (Build parameter for Meson: -Dvulkan-drivers=amd_terascale)

zink & SwiftShader patched to expose VK_HEADER_VERSION_COMPLETE as seen in other drivers

SwiftShader - revert: Remove VK_GOOGLE_sampler_filtering_precision
SwiftShader 32 bit fails to build against LLVM16, ie stuck at LLVM10

Draft: virgl/win: Virtio GPU 3D acceleration for windows
Untested, idk how to configure that :P


JeGX

I hadn't noticed your github page. Nice! ;)

Stefan

#2
Additional driver:
Draft: virgl/win: Virtio GPU 3D acceleration for windows

Untested, idk how to configure that :P

Stefan

Update SwiftShader Fix incorrect macro definition in rc file

Actually the fix didn't work as expected, so i stripped the conditions

#ifdef _WIN64
VALUE "FileDescription", "SwiftShader Vulkan 64-bit Dynamic Link Library"
#else
VALUE "FileDescription", "SwiftShader Vulkan 32-bit Dynamic Link Library"
#endif

Also updated the 3rd party deps glslang, SPIRV-Tools and SPIRV-Headers

Stefan

Update:
Vulkan-Headers 1.3.286

SPIRV changes break MESA
Workaround: rollback vk.xml to 8651835 


zink frozen at last known good commits because of MESA 24.1 - broken zink OpenGL under Windows

Stefan

#5
Update:
spirv,drivers: Implement VK_EXT_shader_replicated_composites

fixes aforementioned SPIRV issues



extension added to dzn_device.c, just 2 lines...
153 .EXT_separate_stencil_usage = true,
+154 .EXT_shader_replicated_composites = true,
796 .vertexAttributeInstanceRateZeroDivisor = true,
+797 .shaderReplicatedComposites = true,

it has been accepted by MESA :)

Stefan


Stefan


Stefan


Stefan


Stefan

#10
Update:
Vulkan-Headers 1.3.288
Mesa 24.2 Adds Support For Fixed-Rate Compression Extensions For OpenGL & EGL

Drivers do not yet contain VK_KHR_shader_relaxed_extended_instruction

zink workaround overhauled as explained at MESA 24.1 - broken zink OpenGL under Windows

Latest Vulkan loader commit added
Latest GLEW32 commit added

Recently "zink on DZN" started working, performance of "zink on WARP" is about half of "zink on SwiftShader" due to low CPU usage.
Switch WARP/GPU via LIBGL_ALWAYS_SOFTWARE true/false








Stefan

#12
Update:
LLVM 18.1.8 Release

Quote
+- LLVM 18.1.8 Fixed an issue that caused ``std::string`` to pass an incorrect size to ``allocator_traits::deallocate``
+  when deallocating memory. The impact is different depending on a few factors:
+  - Users who don't use a custom allocator in ``std::string`` and don't enable sized deallocation (which is
+    off by default in Clang 18) will not be affected. This is expected to be the vast majority of users.
+  - Users who don't use a custom allocator in ``std::string`` but are enabling sized deallocation (e.g. with
+    ``-fsized-deallocation``) will notice that ``operator delete(void*, size_t)`` is now being passed the correct
+    size. This likely has no impact if they were not customizing ``operator delete``.
+  - Users who use a custom allocator in ``std::string`` will notice that they now get passed the correct allocation
+    size upon deallocation.

source: https://github.com/llvm/llvm-project/pull/96116

Stefan


Stefan

Updates:

zink/DZN - Vulkan-Headers 1.3.289
LAVApipe is too broken atm, hence no update

SwiftShader
a0ec371 Change enum values in to avoid implicit bitfield conversion

Vulkan loader 1.3.289

Terakan
  • 770ee8bc · terakan/wddm: Pre-Windows 8 physical device enumeration




Stefan

#15
Updates:

zink/DZN - Vulkan-Headers 1.3.290


Terakan
bddb151e · terakan: WIP: Fragment shader unordered access views


Vulkan-Loader 1.3.290

Stefan


Stefan


Stefan


Stefan