2022-11-24 10:38:49 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Common/Common.h"
|
|
|
|
|
|
2023-08-02 11:38:31 +02:00
|
|
|
// Flags and structs shared between backends that haven't found a good home.
|
|
|
|
|
|
2022-11-24 10:38:49 +01:00
|
|
|
enum class InvalidationFlags {
|
2022-12-01 19:15:38 +01:00
|
|
|
CACHED_RENDER_STATE = 1,
|
2022-11-24 10:38:49 +01:00
|
|
|
};
|
|
|
|
|
ENUM_CLASS_BITOPS(InvalidationFlags);
|
|
|
|
|
|
2022-12-01 19:15:38 +01:00
|
|
|
enum class InvalidationCallbackFlags {
|
|
|
|
|
RENDER_PASS_STATE = 1,
|
|
|
|
|
COMMAND_BUFFER_STATE = 2,
|
|
|
|
|
};
|
|
|
|
|
ENUM_CLASS_BITOPS(InvalidationCallbackFlags);
|
|
|
|
|
|
|
|
|
|
typedef std::function<void(InvalidationCallbackFlags)> InvalidationCallback;
|
2023-08-02 11:38:31 +02:00
|
|
|
|
|
|
|
|
// These are separate from FrameData because we store some history of these.
|
|
|
|
|
// Also, this might be joined with more non-GPU timing information later.
|
|
|
|
|
struct FrameTimeData {
|
2023-08-03 12:59:25 +02:00
|
|
|
uint64_t frameId;
|
2023-08-07 22:35:18 +02:00
|
|
|
|
|
|
|
|
int waitCount;
|
|
|
|
|
|
2023-08-02 11:38:31 +02:00
|
|
|
double frameBegin;
|
|
|
|
|
double afterFenceWait;
|
|
|
|
|
double firstSubmit;
|
|
|
|
|
double queuePresent;
|
2023-08-03 12:59:25 +02:00
|
|
|
|
2023-08-01 18:04:44 +02:00
|
|
|
double actualPresent;
|
2023-08-03 11:11:16 +02:00
|
|
|
double desiredPresentTime;
|
|
|
|
|
double earliestPresentTime;
|
|
|
|
|
double presentMargin;
|
2023-08-02 11:38:31 +02:00
|
|
|
};
|
2023-08-16 11:45:26 +02:00
|
|
|
constexpr size_t FRAME_TIME_HISTORY_LENGTH = 32;
|