Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_CONFIG_H_
34#define DVD_CONFIG_H_
35
37
38namespace Divide {
39namespace Config {
40
41namespace Build {
42#if defined(_DEBUG)
43 constexpr bool IS_DEBUG_BUILD = true;
44
45 constexpr bool IS_PROFILE_BUILD = false;
46 constexpr bool IS_RELEASE_BUILD = false;
47#elif defined(_PROFILE)
48 constexpr bool IS_PROFILE_BUILD = true;
49
50 constexpr bool IS_DEBUG_BUILD = false;
51 constexpr bool IS_RELEASE_BUILD = false;
52#else
53 constexpr bool IS_RELEASE_BUILD = true;
54
55 constexpr bool IS_DEBUG_BUILD = false;
56 constexpr bool IS_PROFILE_BUILD = false;
57#endif
58
59 // Set IS_SHIPPING_BUILD to true to disable non-required functionality for shipped games: editors, debug code, etc
60 constexpr bool IS_SHIPPING_BUILD = IS_RELEASE_BUILD && false;
61#if defined(_START_IN_EDITOR)
62 constexpr bool IS_EDITOR_BUILD = true;
63 constexpr bool ENABLE_EDITOR = true;
64#else //_START_IN_EDITOR
65 constexpr bool IS_EDITOR_BUILD = false;
67#endif //_START_IN_EDITOR
68
69} //namespace Build
70
71namespace Assert {
74
76 constexpr bool SHOW_MESSAGE_BOX = LOG_ASSERTS;
77
79 constexpr bool CONTINUE_ON_ASSERT = false;
80} // namespace Assert
81
82namespace Profile {
84 constexpr unsigned short MAX_PROFILE_TIMERS = 1 << 10;
85
88} // namespace Profile
89
90
91constexpr float ALPHA_DISCARD_THRESHOLD = 1.f - 0.05f;
92
93constexpr unsigned char MINIMUM_VULKAN_MINOR_VERSION = 3u;
94constexpr unsigned char DESIRED_VULKAN_MINOR_VERSION = 3u;
95
97constexpr U16 TARGET_FRAME_RATE = 60;
98
101
104constexpr U8 TICK_DIVISOR = 2u;
105
108
111constexpr size_t REQUIRED_RAM_SIZE_IN_BYTES = 2u * (1024u * 1024 * 1024); //2Gb
112
114constexpr U32 MAX_POOLED_TASKS = 1 << 16;
115
117constexpr U16 MAX_BONE_COUNT_PER_NODE = 1 << 7;
118
120constexpr U16 MAX_VISIBLE_NODES = 1 << 13;
121
123constexpr U16 MAX_CONCURRENT_MATERIALS = 1 << 14;
124
127constexpr U8 MAX_CLIP_DISTANCES = 3u;
128
131constexpr U8 MAX_CULL_DISTANCES = 1u;
132
136
139
142
145
147constexpr U8 MAX_DEBUG_SCOPE_DEPTH = 32u;
148
149namespace Lighting {
154
157
160
162 constexpr U16 MAX_ACTIVE_LIGHTS_PER_FRAME = 1 << 12;
163
165 namespace ClusteredForward {
167 constexpr U16 MAX_LIGHTS_PER_CLUSTER = 100u;
168
170 constexpr U8 CLUSTERS_X = 16u;
171 constexpr U8 CLUSTERS_Y = 8u;
172 constexpr U8 CLUSTERS_Z = 24u;
176 constexpr U16 MAX_COMPUTE_THREADS = 1024u; //Value from some random, old D3D spec, I think ...
177
178 // This may not be a hard requirement but for now it works fine
180 } // namespace ClusteredForward
181} // namespace Lighting
182
183namespace Networking {
186
189} // namespace Networking
190
193
196
197constexpr char DEFAULT_PROJECT_NAME[] = "Default";
198constexpr char DEFAULT_SCENE_NAME[] = "Default";
199constexpr char DELETED_FOLDER_NAME[] = "Deleted";
200constexpr char ENGINE_NAME[] = "Divide Framework";
201constexpr auto ENGINE_VERSION_MAJOR = 0u;
202constexpr auto ENGINE_VERSION_MINOR = 1u;
203constexpr auto ENGINE_VERSION_PATCH = 0u;
204
205} // namespace Config
206} // namespace Divide
207
208constexpr char OUTPUT_LOG_FILE[] = "console.log";
209constexpr char ERROR_LOG_FILE[] = "errors.log";
210
211#endif //DVD_CONFIG_H_
constexpr char ERROR_LOG_FILE[]
Definition: config.h:209
constexpr char OUTPUT_LOG_FILE[]
Definition: config.h:208
constexpr bool LOG_ASSERTS
Log assert fails messages to the error log file.
Definition: config.h:73
constexpr bool CONTINUE_ON_ASSERT
Do not call the platform "assert" function in order to continue application execution.
Definition: config.h:79
constexpr bool SHOW_MESSAGE_BOX
Popup a GUI Message Box on asserts;.
Definition: config.h:76
constexpr bool ENABLE_EDITOR
Definition: config.h:66
constexpr bool IS_SHIPPING_BUILD
Definition: config.h:60
constexpr bool IS_RELEASE_BUILD
Definition: config.h:53
constexpr bool IS_DEBUG_BUILD
Definition: config.h:55
constexpr bool IS_PROFILE_BUILD
Definition: config.h:56
constexpr bool IS_EDITOR_BUILD
Definition: config.h:65
constexpr U8 CLUSTERS_X
Controls compute shader dispatch. e.g. Dispatch Z count = CLUSTERS_Z / CLUSTERS_Z_THREADS.
Definition: config.h:170
constexpr U16 MAX_LIGHTS_PER_CLUSTER
Upper limit of lights used in a cluster. The lower, the better performance at the cost of pop-in/glit...
Definition: config.h:167
constexpr U8 MAX_SHADOW_CASTING_POINT_LIGHTS
Definition: config.h:152
constexpr U8 MAX_SHADOW_CASTING_SPOT_LIGHTS
Definition: config.h:153
constexpr U16 MAX_ACTIVE_LIGHTS_PER_FRAME
Maximum number of lights we process per frame. We need this upper bound for pre-allocating arrays and...
Definition: config.h:162
constexpr U8 MAX_SHADOW_CASTING_LIGHTS
Maximum number of shadow casting lights processed per frame.
Definition: config.h:156
constexpr U8 MAX_CSM_SPLITS_PER_LIGHT
Used for CSM or PSSM to determine the maximum number of frustum splits.
Definition: config.h:159
constexpr U8 MAX_SHADOW_CASTING_DIRECTIONAL_LIGHTS
How many lights (in order as passed to the shader for the node) should cast shadows.
Definition: config.h:151
constexpr U16 NETWORK_SEND_FREQUENCY_HZ
How often should the client send messages to the server.
Definition: config.h:185
constexpr U16 NETWORK_SEND_RETRY_COUNT
How many times should we try to send an update to the server before giving up?
Definition: config.h:188
constexpr bool ENABLE_FUNCTION_PROFILING
Enable function level profiling.
Definition: config.h:87
constexpr unsigned short MAX_PROFILE_TIMERS
How many profiling timers are we allowed to use in our applications. We allocate them upfront,...
Definition: config.h:84
constexpr U16 TARGET_FRAME_RATE
Application desired framerate for physics and input simulations.
Definition: config.h:97
constexpr U16 MAX_CONCURRENT_MATERIALS
Estimated maximum number of materials used in a single frame by all passes combined.
Definition: config.h:123
constexpr U8 MAX_DEBUG_SCOPE_DEPTH
Maximum number of nested debug scopes we support in the renderer.
Definition: config.h:147
constexpr U16 MIN_SLEEP_THRESHOLD_MS
The minimum threshold needed for a threaded loop to use sleep. Update intervals bellow this threshold...
Definition: config.h:107
constexpr U8 MAX_LOCAL_PLAYER_COUNT
Maximum number of players we support locally. We store per-player data such as key-bindings,...
Definition: config.h:144
constexpr auto ENGINE_VERSION_MINOR
Definition: config.h:202
constexpr unsigned char MINIMUM_VULKAN_MINOR_VERSION
Definition: config.h:93
constexpr U32 MAX_POOLED_TASKS
How many tasks should we keep in a per-thread pool to avoid using new/delete (must be power of two)
Definition: config.h:114
constexpr char DELETED_FOLDER_NAME[]
Definition: config.h:199
constexpr bool ENABLE_GPU_VALIDATION
Error callbacks, validations, buffer checks, etc. are controlled by this flag. Heavy performance impa...
Definition: config.h:192
constexpr U8 TICK_DIVISOR
Definition: config.h:104
constexpr U8 MAX_CULL_DISTANCES
Definition: config.h:131
constexpr char DEFAULT_PROJECT_NAME[]
Definition: config.h:197
constexpr unsigned char DESIRED_VULKAN_MINOR_VERSION
Definition: config.h:94
constexpr auto ENGINE_VERSION_PATCH
Definition: config.h:203
constexpr char DEFAULT_SCENE_NAME[]
Definition: config.h:198
constexpr U8 MAX_REFLECTIVE_NODES_IN_VIEW
Definition: config.h:135
constexpr U16 MAX_BONE_COUNT_PER_NODE
Maximum number of bones available per node.
Definition: config.h:117
constexpr U8 MAX_REFLECTIVE_PROBES_PER_PASS
Maximum number of environment probes we are allowed to update per frame.
Definition: config.h:141
constexpr float ALPHA_DISCARD_THRESHOLD
Definition: config.h:91
constexpr U8 MAX_REFRACTIVE_NODES_IN_VIEW
Similar to MAX_REFLECTIVE_NODES_IN_VIEW but for custom refraction passes (e.g. Water,...
Definition: config.h:138
constexpr U16 MAX_VISIBLE_NODES
Estimated maximum number of visible objects per render pass (this includes debug primitives)
Definition: config.h:120
constexpr size_t REQUIRED_RAM_SIZE_IN_BYTES
Definition: config.h:111
constexpr U8 MAX_FRAMES_IN_FLIGHT
Maximum number of active frames until we start waiting on a fence/sync.
Definition: config.h:100
constexpr U8 MAX_CLIP_DISTANCES
Definition: config.h:127
constexpr auto ENGINE_VERSION_MAJOR
Definition: config.h:201
constexpr char ENGINE_NAME[]
Definition: config.h:200
constexpr bool ENABLE_LOCALE_FILE_WATCHER
Scan changes to shader source files, script files, etc to hot-reload assets. Isn't needed in shipping...
Definition: config.h:195
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
uint8_t U8
uint16_t U16
uint32_t U32