summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2021-11-15 14:55:41 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2021-11-22 20:04:57 +0200
commitb11e619b193470050da2fd20fd4cbdb9e791e2b3 (patch)
tree0d28b164f279a6afb20490df97461dfa5220c7f7 /core
parentf2beac49bb9f3271c2369d64dca19b542f52e146 (diff)
[Vulkan] Check each device capabilities before selecting it.
Split instance and physical device selection function and move device selection to window creation, to reject devices without present capability. Add device preferred type check in discrete > integrated > virtual > cpu > other order. Add device list printout. Add command line argument to override device selection.
Diffstat (limited to 'core')
-rw-r--r--core/config/engine.cpp4
-rw-r--r--core/config/engine.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp
index dc5b3e25c6..89700a0747 100644
--- a/core/config/engine.cpp
+++ b/core/config/engine.cpp
@@ -186,6 +186,10 @@ bool Engine::is_abort_on_gpu_errors_enabled() const {
return abort_on_gpu_errors;
}
+int32_t Engine::get_gpu_index() const {
+ return gpu_idx;
+}
+
bool Engine::is_validation_layers_enabled() const {
return use_validation_layers;
}
diff --git a/core/config/engine.h b/core/config/engine.h
index ae33acede2..ca6462d318 100644
--- a/core/config/engine.h
+++ b/core/config/engine.h
@@ -63,6 +63,7 @@ private:
double _physics_interpolation_fraction = 0.0f;
bool abort_on_gpu_errors = false;
bool use_validation_layers = false;
+ int32_t gpu_idx = -1;
uint64_t _process_frames = 0;
bool _in_physics = false;
@@ -135,6 +136,7 @@ public:
bool is_abort_on_gpu_errors_enabled() const;
bool is_validation_layers_enabled() const;
+ int32_t get_gpu_index() const;
Engine();
virtual ~Engine() {}