From 6b9653d261b6847b2c01398066ebef22cbd16854 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 16 Nov 2018 23:45:20 +0100 Subject: [PATCH] [dxvk] Create GPU event pool and forward it to the context --- src/dxvk/dxvk_context.cpp | 2 ++ src/dxvk/dxvk_context.h | 3 +++ src/dxvk/dxvk_device.cpp | 7 +++++++ src/dxvk/dxvk_device.h | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index f5a6d7d4..60d55e78 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -9,6 +9,7 @@ namespace dxvk { DxvkContext::DxvkContext( const Rc& device, const Rc& pipelineManager, + const Rc& gpuEventPool, const Rc& metaClearObjects, const Rc& metaCopyObjects, const Rc& metaMipGenObjects, @@ -16,6 +17,7 @@ namespace dxvk { const Rc& metaResolveObjects) : m_device (device), m_pipeMgr (pipelineManager), + m_gpuEvents (gpuEventPool), m_metaClear (metaClearObjects), m_metaCopy (metaCopyObjects), m_metaMipGen (metaMipGenObjects), diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index 0c00f113..0b08d124 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -6,6 +6,7 @@ #include "dxvk_context_state.h" #include "dxvk_data.h" #include "dxvk_event.h" +#include "dxvk_gpu_event.h" #include "dxvk_meta_clear.h" #include "dxvk_meta_copy.h" #include "dxvk_meta_mipgen.h" @@ -34,6 +35,7 @@ namespace dxvk { DxvkContext( const Rc& device, const Rc& pipelineManager, + const Rc& gpuEventPool, const Rc& metaClearObjects, const Rc& metaCopyObjects, const Rc& metaMipGenObjects, @@ -782,6 +784,7 @@ namespace dxvk { const Rc m_device; const Rc m_pipeMgr; + const Rc m_gpuEvents; const Rc m_metaClear; const Rc m_metaCopy; const Rc m_metaMipGen; diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index e0704313..7fe3af19 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -19,6 +19,7 @@ namespace dxvk { m_memory (new DxvkMemoryAllocator (this)), m_renderPassPool (new DxvkRenderPassPool (vkd)), m_pipelineManager (new DxvkPipelineManager (this, m_renderPassPool.ptr())), + m_gpuEventPool (new DxvkGpuEventPool (vkd)), m_metaClearObjects (new DxvkMetaClearObjects (vkd)), m_metaCopyObjects (new DxvkMetaCopyObjects (vkd)), m_metaMipGenObjects (new DxvkMetaMipGenObjects (vkd)), @@ -140,12 +141,18 @@ namespace dxvk { Rc DxvkDevice::createContext() { return new DxvkContext(this, m_pipelineManager, + m_gpuEventPool, m_metaClearObjects, m_metaCopyObjects, m_metaMipGenObjects, m_metaPackObjects, m_metaResolveObjects); } + + + Rc DxvkDevice::createGpuEvent() { + return new DxvkGpuEvent(m_vkd); + } Rc DxvkDevice::createFramebuffer( diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index 1f867c28..fc967f77 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -201,6 +201,12 @@ namespace dxvk { * \returns The context object */ Rc createContext(); + + /** + * \brief Creates a GPU event + * \returns New GPU event + */ + Rc createGpuEvent(); /** * \brief Creates framebuffer for a set of render targets @@ -398,6 +404,8 @@ namespace dxvk { Rc m_renderPassPool; Rc m_pipelineManager; + Rc m_gpuEventPool; + Rc m_metaClearObjects; Rc m_metaCopyObjects; Rc m_metaMipGenObjects;