Removing PAL.

This commit is contained in:
Ben Vanik
2014-08-16 21:19:21 -07:00
parent 6cb9ca432f
commit fdab788017
15 changed files with 16 additions and 374 deletions

View File

@@ -9,6 +9,8 @@
#include <xenia/gpu/d3d11/d3d11_graphics_system.h>
#include <chrono>
#include <poly/math.h>
#include <xenia/emulator.h>
#include <xenia/gpu/gpu-private.h>
@@ -24,8 +26,7 @@ using namespace xe::gpu::d3d11;
D3D11GraphicsSystem::D3D11GraphicsSystem(Emulator* emulator)
: GraphicsSystem(emulator),
window_(nullptr), dxgi_factory_(nullptr), device_(nullptr),
timer_queue_(nullptr), vsync_timer_(nullptr),
last_swap_time_(0.0) {
timer_queue_(nullptr), vsync_timer_(nullptr) {
}
D3D11GraphicsSystem::~D3D11GraphicsSystem() {
@@ -142,8 +143,9 @@ void D3D11GraphicsSystem::Initialize() {
void D3D11GraphicsSystem::Pump() {
SCOPE_profile_cpu_f("gpu");
double time_since_last_swap = xe_pal_now() - last_swap_time_;
if (time_since_last_swap > 1.0) {
auto time_since_last_swap = std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::high_resolution_clock::now() - last_swap_time_);
if (time_since_last_swap.count() > 1) {
// Force a swap when profiling.
if (Profiler::is_enabled()) {
window_->Swap();
@@ -159,7 +161,7 @@ void D3D11GraphicsSystem::Swap() {
// If we are set to vsync this will block.
window_->Swap();
last_swap_time_ = xe_pal_now();
last_swap_time_ = std::chrono::high_resolution_clock::now();
}
void __stdcall D3D11GraphicsSystem::VsyncCallback(D3D11GraphicsSystem* gs,

View File

@@ -49,7 +49,7 @@ private:
HANDLE timer_queue_;
HANDLE vsync_timer_;
double last_swap_time_;
std::chrono::high_resolution_clock::time_point last_swap_time_;
};

View File

@@ -29,7 +29,7 @@ GraphicsSystem::GraphicsSystem(Emulator* emulator) :
running_(false), driver_(nullptr),
command_processor_(nullptr),
interrupt_callback_(0), interrupt_callback_data_(0),
last_interrupt_time_(0), thread_wait_(nullptr) {
thread_wait_(nullptr) {
// Create the run loop used for any windows/etc.
// This must be done on the thread we create the driver.
run_loop_ = xe_run_loop_create();
@@ -193,7 +193,6 @@ void GraphicsSystem::DispatchInterruptCallback(
}
// NOTE: we may be executing in some random thread.
last_interrupt_time_ = xe_pal_now();
if (!interrupt_callback_) {
return;
}

View File

@@ -81,7 +81,6 @@ protected:
uint32_t interrupt_callback_;
uint32_t interrupt_callback_data_;
double last_interrupt_time_;
HANDLE thread_wait_;
};