CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/GPU/OpenGL/GLFrameData.h
Views: 1401
1
#pragma once
2
3
#include <mutex>
4
#include <condition_variable>
5
#include <vector>
6
#include <string>
7
#include <set>
8
9
#include "Common/GPU/OpenGL/GLCommon.h"
10
11
class GLRShader;
12
class GLRBuffer;
13
class GLRTexture;
14
class GLRInputLayout;
15
class GLRFramebuffer;
16
class GLPushBuffer;
17
class GLRProgram;
18
class GLRenderManager;
19
20
class GLDeleter {
21
public:
22
void Perform(GLRenderManager *renderManager, bool skipGLCalls);
23
24
bool IsEmpty() const {
25
return shaders.empty() && programs.empty() && buffers.empty() && textures.empty() && inputLayouts.empty() && framebuffers.empty() && pushBuffers.empty();
26
}
27
28
void Take(GLDeleter &other);
29
30
std::vector<GLRShader *> shaders;
31
std::vector<GLRProgram *> programs;
32
std::vector<GLRBuffer *> buffers;
33
std::vector<GLRTexture *> textures;
34
std::vector<GLRInputLayout *> inputLayouts;
35
std::vector<GLRFramebuffer *> framebuffers;
36
std::vector<GLPushBuffer *> pushBuffers;
37
};
38
39
struct GLQueueProfileContext {
40
bool enabled;
41
double cpuStartTime;
42
double cpuEndTime;
43
std::string passesString;
44
int commandCounts[25]; // Can't grab count from the enum as it would mean a circular include. Might clean this up later.
45
};
46
47
48
// Per-frame data, round-robin so we can overlap submission with execution of the previous frame.
49
struct GLFrameData {
50
bool skipSwap = false;
51
52
// Frames need unique IDs to wait for present on, let's keep them here.
53
// Also used for indexing into the frame timing history buffer.
54
uint64_t frameId;
55
56
std::mutex fenceMutex;
57
std::condition_variable fenceCondVar;
58
bool readyForFence = true;
59
60
// Swapchain.
61
bool hasBegun = false;
62
63
GLDeleter deleter;
64
GLDeleter deleter_prev;
65
std::set<GLPushBuffer *> activePushBuffers;
66
67
GLQueueProfileContext profile;
68
};
69
70