Skip to content

Commit

Permalink
Update vulkanSDK (#825)
Browse files Browse the repository at this point in the history
- Use a fixed sdkVersion variable
- Use JSON.stringify to make winevulkan.json
- Use regedit plugin instead of "wine reg add ..."
- Fix \\ in .reg
  • Loading branch information
ImperatorS79 committed Feb 26, 2019
1 parent eb21277 commit 7a5412a
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions Engines/Wine/Verbs/vulkanSDK/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

include("engines.wine.engine.object");
include("engines.wine.plugins.regedit");
include("utils.functions.net.resource");
Expand All @@ -12,26 +13,44 @@ Wine.prototype.vulkanSDK = function () {
print("NOTE: you need a graphic driver that supports Vulkan to run winevulkan");
print("NOTE: Vulkan works in wine from version 3.3 (if compiled with vulkan support)");

var sdkVersion="1.1.97.0";

var setupFile = new Resource()
.wizard(this.wizard())
.url("https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe?u=")
//checksum changes everytime a new version is released
.name("vulkan-sdk.exe")
.url("https://sdk.lunarg.com/sdk/download/" + sdkVersion + "/windows/VulkanSDK-" + sdkVersion + "-Installer.exe")
.checksum("6bab01f98473bfd550544bbe9773a6d05872a61a")
.name("VulkanSDK-" + sdkVersion + "-Installer.exe")
.get();

this.run(setupFile, "/S");
this.wait();

var pathVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json";
touch(pathVulkanJSON);
var contentVulkanJSON = JSON.stringify({"file_format_version": "1.0.0", "ICD": {"library_path": "c:\\windows\\system32\\winevulkan.dll",
"api_version": sdkVersion}}, null, 4);

writeToFile(pathVulkanJSON, contentVulkanJSON);

var patchVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json";
touch(patchVulkanJSON);
writeToFile(patchVulkanJSON, "{\n \"file_format_version\": \"1.0.0\",\n \"ICD\": {\n \"library_path\": \"c:\windows\system32\winevulkan.dll\",\n \"api_version\": \"1.1.92.1\"\n }\n}");
this.run("reg", ["add", "HKLM\Software\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true);
var regeditFileContent32 =
"REGEDIT4\n" +
"\n" +
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\Drivers]\n" +
"\"C:\\\\Windows\\\\winevulkan.json\"=dword:00000000" ;

this.regedit().patch(regeditFileContent32);

if (this.architecture() == "amd64") {
this.run("reg", ["add", "HKLM\Software\Wow6432Node\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true);
var regeditFileContent64 =
"REGEDIT4\n" +
"\n" +
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Khronos\\Vulkan\\Drivers\\]\n" +
"\"C:\\\\Windows\\\\winevulkan.json\"=dword:00000000" ;

this.regedit().patch(regeditFileContent64);
}

return this;

}

/**
Expand Down

0 comments on commit 7a5412a

Please sign in to comment.