Refactoring to enable future time scaling, coordinated clocks, etc.

This commit is contained in:
Ben Vanik
2015-05-26 22:20:46 -07:00
parent 05f2577fb7
commit 8244409501
19 changed files with 213 additions and 57 deletions

View File

@@ -59,7 +59,6 @@ CommandProcessor::CommandProcessor(GL4GraphicsSystem* graphics_system)
trace_state_(TraceState::kDisabled),
worker_running_(true),
swap_mode_(SwapMode::kNormal),
time_base_(0),
counter_(0),
primary_buffer_ptr_(0),
primary_buffer_size_(0),
@@ -83,19 +82,10 @@ CommandProcessor::CommandProcessor(GL4GraphicsSystem* graphics_system)
draw_index_count_(0),
draw_batcher_(graphics_system_->register_file()),
scratch_buffer_(kScratchBufferCapacity, kScratchBufferAlignment) {
LARGE_INTEGER perf_counter;
QueryPerformanceCounter(&perf_counter);
time_base_ = perf_counter.QuadPart;
}
CommandProcessor::~CommandProcessor() { CloseHandle(write_ptr_index_event_); }
uint64_t CommandProcessor::QueryTime() {
LARGE_INTEGER perf_counter;
QueryPerformanceCounter(&perf_counter);
return perf_counter.QuadPart - time_base_;
}
bool CommandProcessor::Initialize(std::unique_ptr<GLContext> context) {
context_ = std::move(context);