Skip to content

Commit 0607d39

Browse files
vkconfig: March SDK bugfixing
Change-Id: I511d8513355d23cc53014676d759f2052904088e
1 parent f53dd66 commit 0607d39

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

vkconfig_core/executable.cpp

+24-18
Original file line numberDiff line numberDiff line change
@@ -153,30 +153,36 @@ Executable::Executable(const DefaultExecutable& default_executable) {
153153

154154
this->path = default_paths.executable_path;
155155

156-
for (std::size_t i = 0, n = default_executable.options.size(); i < n; ++i) {
156+
if (default_executable.options.empty()) {
157157
ExecutableOptions options;
158-
options.label = default_executable.options[i].label;
159-
if (default_executable.options[i].working_folder.Empty()) {
160-
options.working_folder = default_paths.working_folder;
161-
} else {
162-
options.working_folder = default_executable.options[i].working_folder;
163-
}
164-
options.args = SplitSpace(default_executable.options[i].args);
165-
options.envs = SplitSpace(default_executable.options[i].envs);
166-
167-
// On all operating systems, but Windows we keep running into problems with this ending up
168-
// somewhere the user isn't allowed to create and write files. For consistncy sake, the log
169-
// initially will be set to the users home folder across all OS's. This is highly visible
170-
// in the application launcher and should not present a usability issue. The developer can
171-
// easily change this later to anywhere they like.
158+
options.label = "Default Options";
159+
options.working_folder = default_paths.working_folder;
172160
options.log_file = std::string("${VULKAN_HOME}/") + default_executable.name + ".txt";
173-
174161
this->options_list.push_back(options);
162+
} else {
163+
for (std::size_t i = 0, n = default_executable.options.size(); i < n; ++i) {
164+
ExecutableOptions options;
165+
options.label = default_executable.options[i].label;
166+
if (default_executable.options[i].working_folder.Empty()) {
167+
options.working_folder = default_paths.working_folder;
168+
} else {
169+
options.working_folder = default_executable.options[i].working_folder;
170+
}
171+
options.args = SplitSpace(default_executable.options[i].args);
172+
options.envs = SplitSpace(default_executable.options[i].envs);
173+
174+
// On all operating systems, but Windows we keep running into problems with this ending up
175+
// somewhere the user isn't allowed to create and write files. For consistncy sake, the log
176+
// initially will be set to the users home folder across all OS's. This is highly visible
177+
// in the application launcher and should not present a usability issue. The developer can
178+
// easily change this later to anywhere they like.
179+
options.log_file = std::string("${VULKAN_HOME}/") + default_executable.name + ".txt";
175180

176-
if (i == 0) {
177-
this->active_options = options.label;
181+
this->options_list.push_back(options);
178182
}
179183
}
184+
185+
this->active_options = this->options_list[0].label;
180186
}
181187

182188
Executable::Executable(const Path& executable_path) {

0 commit comments

Comments
 (0)