Skip to content

Commit

Permalink
bugfix vulkan layers
Browse files Browse the repository at this point in the history
  • Loading branch information
hitman249 committed Apr 7, 2020
1 parent d87a2e2 commit c140a39
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
17 changes: 17 additions & 0 deletions src/src/modules/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,24 @@ export default class Command {
}

let preloaded = [];
let vkLayers = [];

if (this.prefix.isVkBasalt() && this.prefix.isVkBasaltLib()) {
exported.ENABLE_VKBASALT = 1;
exported.VKBASALT_CONFIG_FILE = this.prefix.getVkBasaltConfFile();
exported.VKBASALT_LOG_FILE = this.prefix.getLogFileVkBasalt();

let vkBasalt = window.app.getVkBasalt();

vkLayers.push(vkBasalt.getLayer32().layer.name);
vkLayers.push(vkBasalt.getLayer64().layer.name);
}

if (this.prefix.isMangoHud()) {
let mangoHud = window.app.getMangoHud();

vkLayers.push(mangoHud.getLayer32().layer.name);
vkLayers.push(mangoHud.getLayer64().layer.name);
}

if (this.config) {
Expand All @@ -191,6 +204,10 @@ export default class Command {
if (preloaded.length > 0) {
exported.LD_PRELOAD = '$LD_PRELOAD:' + preloaded.join(':');
}

if (vkLayers.length > 0) {
exported.VK_INSTANCE_LAYERS = '$VK_INSTANCE_LAYERS:' + vkLayers.join(':');
}
}

let env = Object.keys(exported).map((field) => `export ${field}="${exported[field]}"`).join('; ');
Expand Down
13 changes: 4 additions & 9 deletions src/src/modules/mango-hud.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,8 @@ export default class MangoHud {
return promise;
}

if (!this.fs.exists(file32)) {
this.fs.filePutContents(file32, Utils.jsonEncode(this.getLayer32()));
}

if (!this.fs.exists(file64)) {
this.fs.filePutContents(file64, Utils.jsonEncode(this.getLayer64()));
}
this.fs.filePutContents(file32, Utils.jsonEncode(this.getLayer32()));
this.fs.filePutContents(file64, Utils.jsonEncode(this.getLayer64()));

let win32 = this.prefix.getMangoHudLibPath('win32');

Expand All @@ -91,7 +86,7 @@ export default class MangoHud {
return {
"file_format_version": "1.0.0",
"layer": {
"name": "MangoHud x86",
"name": "VK_LAYER_MangoHud_32",
"type": "GLOBAL",
"api_version": "1.1.125",
"library_path": this.prefix.getMangoHudLibPath('win32'),
Expand All @@ -115,7 +110,7 @@ export default class MangoHud {
return {
"file_format_version": "1.0.0",
"layer": {
"name": "MangoHud x86_64",
"name": "VK_LAYER_MangoHud_64",
"type": "GLOBAL",
"api_version": "1.1.125",
"library_path": this.prefix.getMangoHudLibPath('win64'),
Expand Down
13 changes: 2 additions & 11 deletions src/src/modules/vk-basalt.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,8 @@ export default class VkBasalt {
this.fs.filePutContents(config, this.getConfig());
}

if (!this.fs.exists(file32)) {
this.fs.filePutContents(file32, Utils.jsonEncode(this.getLayer32()));
}

if (!this.fs.exists(file64)) {
this.fs.filePutContents(file64, Utils.jsonEncode(this.getLayer64()));
}

if (!this.fs.exists(file64)) {
this.fs.filePutContents(file64, Utils.jsonEncode(this.getLayer64()));
}
this.fs.filePutContents(file32, Utils.jsonEncode(this.getLayer32()));
this.fs.filePutContents(file64, Utils.jsonEncode(this.getLayer64()));

let win32 = this.prefix.getVkBasaltLibPath('win32');

Expand Down

0 comments on commit c140a39

Please sign in to comment.