MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_task_defs.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_TASK_DEFS_H_1622685164
12#define INCGUARD_MGL_TASK_DEFS_H_1622685164
13
14#include <cstddef>
15#include <cstdint>
16#include <type_traits>
17
20
21namespace MGL::Task
22{
24using Identifier = uint32_t;
25
27enum class UniqueIdentifier : uint64_t
28{
29 Invalid = 0,
30 Start = 1,
31 End = ~static_cast<std::underlying_type_t<UniqueIdentifier>>(0),
32};
33
35constexpr UniqueIdentifier operator++(UniqueIdentifier &rhs) noexcept
36{
37 rhs = UniqueIdentifier{static_cast<std::underlying_type_t<UniqueIdentifier>>(rhs) + 1};
38 if (rhs >= UniqueIdentifier::End)
39 {
40 rhs = UniqueIdentifier::Start;
41 }
42
43 return rhs;
44}
45
47constexpr UniqueIdentifier operator++(UniqueIdentifier &rhs, int) noexcept
48{
49 auto ret = rhs;
50 rhs = UniqueIdentifier{static_cast<std::underlying_type_t<UniqueIdentifier>>(rhs) + 1};
51 if (rhs >= UniqueIdentifier::End)
52 {
53 rhs = UniqueIdentifier::Start;
54 }
55
56 return ret;
57}
58
60enum class ExecuteMode : uint8_t
61{
65};
66
68using ExecuteStage = uint8_t;
69
72
75{
78
79 /* ------------------------------------------------------------------------- */
85 /* ------------------------------------------------------------------------- */
86 constexpr StageSettings(ExecuteStage inStage, ExecuteMode inMode) noexcept
87 : stage(inStage)
88 , mode(inMode)
89 {
90 MGL_ASSERT(stage < kExecuteStageMax, "[MGL Task] Execute stage must be under %d.", kExecuteStageMax);
91 }
92};
93
96
99{
100 StageSettingsArray stageSettings;
101 int32_t parallelExecuteCount{0};
102};
103
105using EventIdentifier = uint32_t;
106
108enum class ResideLevel : uint8_t
109{
110 NoResident = 0,
111 Low = 0x40,
112 Middle = 0x70,
113 High = 0xB0,
114 Max = 0xFF,
115};
116
117} // namespace MGL::Task
118
119#endif // INCGUARD_MGL_TASK_DEFS_H_1622685164
120
121// vim: et ts=4 sw=4 sts=4
uint32_t Identifier
実績用の識別子の型
Definition mgl_achievement_defs.h:26
MGL STLコンテナの代替
std::vector< T, Allocator< T > > vector
std::vectorの代替
Definition mgl_stl_containers.h:51
MGL デバッグ用マクロ
#define MGL_ASSERT(...)
アサート用マクロ
Definition mgl_system_debug_macro.h:88
ResideLevel
常駐レベル
Definition mgl_task_defs.h:109
@ NoResident
常駐しない
constexpr ExecuteStage kExecuteStageMax
実行ステージの最大数
Definition mgl_task_defs.h:71
uint32_t EventIdentifier
イベントIDを表す型
Definition mgl_task_defs.h:105
uint8_t ExecuteStage
実行ステージ
Definition mgl_task_defs.h:68
ExecuteMode
実行モード
Definition mgl_task_defs.h:61
@ ParallelizableUpdate
並列化可能な更新
@ NormalUpdate
通常更新
@ RenderUpdate
描画用の更新
STL::vector< StageSettings > StageSettingsArray
実行ステージ設定の配列
Definition mgl_task_defs.h:95
UniqueIdentifier
タスクのユニークIDを表す型
Definition mgl_task_defs.h:28
初期化記述子
Definition mgl_task_defs.h:99
実行ステージ設定
Definition mgl_task_defs.h:75
ExecuteMode mode
実行モード
Definition mgl_task_defs.h:77
constexpr StageSettings(ExecuteStage inStage, ExecuteMode inMode) noexcept
コンストラクタ
Definition mgl_task_defs.h:86
ExecuteStage stage
実行ステージ
Definition mgl_task_defs.h:76