summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-03-18 01:06:53 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-03-18 01:06:53 +0000
commit7eee33910e478c7fb2995fbabcd9a0d8e58eb6f8 (patch)
tree1e190217bcb9d45387df05809ccfa0ace7ffaf15 /Graphics/GraphicsEngineVulkan
parentComment + minor updates (diff)
downloadDiligentCore-7eee33910e478c7fb2995fbabcd9a0d8e58eb6f8.tar.gz
DiligentCore-7eee33910e478c7fb2995fbabcd9a0d8e58eb6f8.zip
Added CommandQueueVk object initialization
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp13
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp10
2 files changed, 15 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp
index bf7c3527..dc6eb140 100644
--- a/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp
@@ -27,10 +27,11 @@
namespace Diligent
{
-CommandQueueVkImpl::CommandQueueVkImpl(IReferenceCounters *pRefCounters, void *pVkNativeCmdQueue, void *pVkFence) :
- TBase(pRefCounters)/*,
- m_pVkCmdQueue(pVkNativeCmdQueue),
- m_VkFence(pVkFence),
+CommandQueueVkImpl::CommandQueueVkImpl(IReferenceCounters *pRefCounters, VkQueue VkNativeCmdQueue, uint32_t QueueFamilyIndex) :
+ TBase(pRefCounters),
+ m_VkQueue(VkNativeCmdQueue),
+ m_QueueFamilyIndex(QueueFamilyIndex)
+ /*m_VkFence(pVkFence),
m_NextFenceValue(1),
m_WaitForGPUEventHandle( CreateEvent(nullptr, false, false, nullptr) )
*/
@@ -41,7 +42,9 @@ CommandQueueVkImpl::CommandQueueVkImpl(IReferenceCounters *pRefCounters, void *p
CommandQueueVkImpl::~CommandQueueVkImpl()
{
-// CloseHandle(m_WaitForGPUEventHandle);
+ // Queues are created along with a logical device during vkCreateDevice.
+ // All queues associated with a logical device are destroyed when vkDestroyDevice
+ // is called on that device.
}
IMPLEMENT_QUERY_INTERFACE( CommandQueueVkImpl, IID_CommandQueueVk, TBase )
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
index 44e3adfd..0d60766c 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp
@@ -187,6 +187,12 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea
&Queue);
VERIFY_EXPR(Queue != VK_NULL_HANDLE);
+ RefCntAutoPtr<CommandQueueVkImpl> pCmdQueueVk;
+
+ auto &RawMemAllocator = GetRawAllocator();
+ pCmdQueueVk = NEW_RC_OBJ(RawMemAllocator, "CommandQueueVk instance", CommandQueueVkImpl)(Queue, QueueInfo.queueFamilyIndex);
+
+
//vkDestroyDevice(VulkanDevice, Instance->GetVkAllocator());
}
@@ -217,7 +223,7 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea
}
- RefCntAutoPtr<CommandQueueVkImpl> pCmdQueueVk;
+
CComPtr<IVkDevice> VkDevice;
try
{
@@ -305,8 +311,6 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea
CHECK_D3D_RESULT_THROW(hr, "Failed to create main command queue fence");
VkDevice->SetName(L"Main Command Queue fence");
- auto &RawMemAllocator = GetRawAllocator();
- pCmdQueueVk = NEW_RC_OBJ(RawMemAllocator, "CommandQueueVk instance", CommandQueueVkImpl)(pVkCmdQueue, pVkFence);
}
catch( const std::runtime_error & )
{