RequestSwap to force a swap from the GL thread.

This commit is contained in:
Ben Vanik
2015-02-21 11:18:22 -08:00
parent 9b21dd8874
commit 5227fe72b5
5 changed files with 60 additions and 34 deletions

View File

@@ -43,6 +43,11 @@ struct SwapParameters {
GLenum attachment;
};
enum class SwapMode {
kNormal,
kIgnored,
};
class CommandProcessor {
public:
CommandProcessor(GL4GraphicsSystem* graphics_system);
@@ -59,6 +64,9 @@ class CommandProcessor {
void Shutdown();
void CallInThread(std::function<void()> fn);
void set_swap_mode(SwapMode swap_mode) { swap_mode_ = swap_mode; }
void IssueSwap();
void BeginTracing(const std::wstring& root_path);
void EndTracing();
@@ -207,6 +215,8 @@ class CommandProcessor {
std::function<void()> pending_fn_;
HANDLE pending_fn_event_;
SwapMode swap_mode_;
uint64_t time_base_;
uint32_t counter_;