PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
launch_gpu_defaults.h
1#pragma once
2
3#include "pixelbullet/application/specification.h"
4
5#include <cstdint>
6#include <filesystem>
7#include <optional>
8#include <string>
9
10namespace pixelbullet
11{
13{
14 std::optional<uint32_t> gpu_index;
15 std::optional<GraphicsDevicePreference> gpu_preference;
16};
17
18enum class LaunchGpuSelectorSource : uint8_t
19{
20 ImplicitAuto,
21 ExplicitGpuPreference,
22 ExplicitGpuIndex,
23 SavedGpuPreference,
24 SavedGpuIndex,
25};
26
28{
29 std::filesystem::path path;
30 std::optional<SavedGpuLaunchDefault> saved_default;
31 std::string warning_message;
32};
33
35{
36 ApplicationBootstrap effective_bootstrap;
37 std::filesystem::path path;
38 std::optional<SavedGpuLaunchDefault> saved_default;
39 LaunchGpuSelectorSource selector_source = LaunchGpuSelectorSource::ImplicitAuto;
40 bool applied_saved_default = false;
41 std::string warning_message;
42};
43
44[[nodiscard]] std::filesystem::path GetDefaultLaunchGpuDefaultsPath(const std::filesystem::path& binary_path);
45[[nodiscard]] LaunchGpuDefaultsLoadResult LoadLaunchGpuDefaults(const std::filesystem::path& path);
46[[nodiscard]] bool SaveLaunchGpuDefault(const std::filesystem::path& path, const SavedGpuLaunchDefault& saved_default,
47 std::string* error_message);
48[[nodiscard]] bool ClearLaunchGpuDefault(const std::filesystem::path& path, std::string* error_message);
49[[nodiscard]] std::string DescribeSavedGpuLaunchDefault(const SavedGpuLaunchDefault& saved_default);
50[[nodiscard]] std::string DescribeResolvedGpuSelector(const ResolvedLaunchGpuDefaults& resolved_defaults);
51} // namespace pixelbullet
Definition specification.h:79
Definition launch_gpu_defaults.h:28
Definition launch_gpu_defaults.h:35
Definition launch_gpu_defaults.h:13