diff options
| author | Dr. Chat <arkolbed@gmail.com> | 2018-05-14 15:01:43 -0500 |
|---|---|---|
| committer | Dr. Chat <arkolbed@gmail.com> | 2018-10-12 14:54:02 -0500 |
| commit | 3108677a4db1656fb2058e12f96fd5633714f52a (patch) | |
| tree | 57985641bcd8367d911a854445f04bc825aba289 | |
| parent | 99d6788b2c8ed141613681089d7cbd7e3cd7a391 (diff) | |
[GPU] Public swap callback function
| -rw-r--r-- | src/xenia/gpu/command_processor.h | 2 | ||||
| -rw-r--r-- | src/xenia/gpu/graphics_system.cc | 6 | ||||
| -rw-r--r-- | src/xenia/gpu/graphics_system.h | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/xenia/gpu/command_processor.h b/src/xenia/gpu/command_processor.h index 8385ac1bb..bd1d56b91 100644 --- a/src/xenia/gpu/command_processor.h +++ b/src/xenia/gpu/command_processor.h @@ -126,7 +126,7 @@ class CommandProcessor { void IssueSwap(uint32_t frontbuffer_ptr, uint32_t frontbuffer_width, uint32_t frontbuffer_height); - void set_swap_request_handler(std::function<void()> fn) { + void SetSwapCallback(std::function<void()> fn) { swap_request_handler_ = fn; } diff --git a/src/xenia/gpu/graphics_system.cc b/src/xenia/gpu/graphics_system.cc index 894cb4252..08d3107a9 100644 --- a/src/xenia/gpu/graphics_system.cc +++ b/src/xenia/gpu/graphics_system.cc @@ -54,8 +54,6 @@ X_STATUS GraphicsSystem::Setup( return X_STATUS_UNSUCCESSFUL; } - command_processor_->set_swap_request_handler([]() {}); - // Let the processor know we want register access callbacks. memory_->AddVirtualMappedRange( 0x7FC80000, 0xFFFF0000, 0x0000FFFF, this, @@ -113,6 +111,10 @@ void GraphicsSystem::Reset() { xe::FatalError("Graphics device lost (probably due to an internal error)"); } +void GraphicsSystem::SetSwapCallback(std::function<void()> fn) { + command_processor_->SetSwapCallback(fn); +} + uint32_t GraphicsSystem::ReadRegisterThunk(void* ppc_context, GraphicsSystem* gs, uint32_t addr) { return gs->ReadRegister(addr); diff --git a/src/xenia/gpu/graphics_system.h b/src/xenia/gpu/graphics_system.h index f441e2f10..8e76adbcb 100644 --- a/src/xenia/gpu/graphics_system.h +++ b/src/xenia/gpu/graphics_system.h @@ -62,6 +62,8 @@ class GraphicsSystem { virtual void ClearCaches(); + void SetSwapCallback(std::function<void()> fn); + void RequestFrameTrace(); void BeginTracing(); void EndTracing(); |
