-
Notifications
You must be signed in to change notification settings - Fork 46
Update vulkanSDK (downloading latest version, rewrote .json file and registry entries creation) #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update vulkanSDK (downloading latest version, rewrote .json file and registry entries creation) #742
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
254649c
Merge pull request #1 from PhoenicisOrg/master
Zemogiter 63f898c
Merge pull request #3 from PhoenicisOrg/master
Zemogiter 71cd3d8
Merge pull request #4 from PhoenicisOrg/master
Zemogiter 60c3cb5
Merge pull request #5 from PhoenicisOrg/master
Zemogiter 69e7bf2
Merge pull request #6 from PhoenicisOrg/master
Zemogiter 5bf56fe
Merge pull request #7 from PhoenicisOrg/master
Zemogiter 1c4fe31
Merge pull request #8 from PhoenicisOrg/master
Zemogiter 66bd276
Merge pull request #9 from PhoenicisOrg/master
Zemogiter 60481ec
Update script.js
Zemogiter a3f3218
Merge branch 'master' into vulkansdk-fix
Zemogiter cf7e695
Update script.js
Zemogiter f840543
Update script.js
Zemogiter fb6f4e7
Update script.js
Zemogiter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,52 @@ | ||
include(["engines", "wine", "engine", "object"]); | ||
include(["engines", "wine", "plugins", "regedit"]); | ||
include(["utils", "functions", "net", "resource"]); | ||
include(["utils", "functions", "filesystem", "files"]); | ||
|
||
/** | ||
* Verb to install all the necessary things to run winevulkan (even inside wine mainline or newest wine-staging) | ||
* see: https://github.com/roderickc/wine-vulkan | ||
* @returns {Wine} Wine object | ||
*/ | ||
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.73.0"; | ||
|
||
var setupFile = new Resource() | ||
.wizard(this.wizard()) | ||
.url("https://sdk.lunarg.com/sdk/download/" + sdkVersion +"/windows/VulkanSDK-" + sdkVersion + "-Installer.exe") | ||
.checksum("ac34f732818c409bcb283b5c6100b373ab6a2404") | ||
.name("VulkanSDK-" + sdkVersion + "-Installer.exe") | ||
.get(); | ||
|
||
this.run(setupFile, "/S"); | ||
|
||
var pathVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json" | ||
var contentVulkanJSON = '{\n' + | ||
' "file_format_version": "1.0.0",\n' + | ||
' "ICD": {\n' + | ||
' "library_path": "c:\\windows\\system32\\winevulkan.dll",\n' + | ||
' "api_version": "' + sdkVersion +'"\n' + | ||
' }\n' + | ||
'}' | ||
|
||
writeToFile(pathVulkanJSON, contentVulkanJSON); | ||
|
||
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") { | ||
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; | ||
} | ||
|
||
/** | ||
* Verb to install all the necessary things to run winevulkan (even inside wine mainline or newest wine-staging) | ||
*/ | ||
var verbImplementation = { | ||
install: function (container) { | ||
var wine = new Wine(); | ||
wine.prefix(container); | ||
var wizard = SetupWizard(InstallationType.VERBS, "vulkanSDK", java.util.Optional.empty()); | ||
wine.wizard(wizard); | ||
wine.vulkanSDK(); | ||
wizard.close(); | ||
} | ||
}; | ||
|
||
/* exported Verb */ | ||
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation); | ||
|
||
include(["engines", "wine", "engine", "object"]); | ||
include(["engines", "wine", "plugins", "regedit"]); | ||
include(["utils", "functions", "net", "resource"]); | ||
include(["utils", "functions", "filesystem", "files"]); | ||
|
||
/** | ||
* All the necessary things to run winevulkan (even inside wine mainline or newest wine-staging) | ||
* -> https://github.com/roderickc/wine-vulkan | ||
* @returns {Wine} Wine object | ||
*/ | ||
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 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") | ||
.get(); | ||
|
||
this.run(setupFile, "/S"); | ||
|
||
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); | ||
|
||
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); | ||
} | ||
|
||
return this; | ||
|
||
} | ||
|
||
/** | ||
* Verb to install all the necessary things to run winevulkan (even inside wine mainline or newest wine-staging) | ||
*/ | ||
var verbImplementation = { | ||
install: function (container) { | ||
var wine = new Wine(); | ||
wine.prefix(container); | ||
var wizard = SetupWizard(InstallationType.VERBS, "vulkanSDK", java.util.Optional.empty()); | ||
wine.wizard(wizard); | ||
wine.vulkanSDK(); | ||
wizard.close(); | ||
} | ||
}; | ||
|
||
/* exported Verb */ | ||
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be possible to use the
regedit
plugin. If you explicitly want to useadd
instead ofregedit.patch
, you should add an according method to the plugin.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can create a ticket to fix this later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.