Skip to content

Commit

Permalink
transfer queue removed
Browse files Browse the repository at this point in the history
  • Loading branch information
beaumanvienna committed Sep 10, 2024
1 parent b57839d commit 396561c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
24 changes: 2 additions & 22 deletions engine/platform/Vulkan/VKdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ namespace GfxRenderEngine
{
vkQueueWaitIdle(m_GraphicsQueue);
vkQueueWaitIdle(m_PresentQueue);
vkQueueWaitIdle(m_TransfertQueue);
}

void VK_Device::CreateInstance()
Expand Down Expand Up @@ -228,10 +227,6 @@ namespace GfxRenderEngine
{
++queuesPerFamily;
}
if (familyIndex == indices.m_TransferFamily)
{ // transfer
++queuesPerFamily;
}
if (queuesPerFamily)
{
QueueSpec spec = {
Expand Down Expand Up @@ -286,9 +281,6 @@ namespace GfxRenderEngine

vkGetDeviceQueue(m_Device, indices.m_GraphicsFamily, indices.m_QueueIndices[QueueTypes::GRAPHICS], &m_GraphicsQueue);
vkGetDeviceQueue(m_Device, indices.m_PresentFamily, indices.m_QueueIndices[QueueTypes::PRESENT], &m_PresentQueue);
vkGetDeviceQueue(m_Device, indices.m_TransferFamily, indices.m_QueueIndices[QueueTypes::TRANSFER],
&m_TransfertQueue);
m_TransferQueueSupportsGraphics = indices.m_GraphicsFamily == indices.m_TransferFamily;
// PrintAllSupportedFormats();
}

Expand Down Expand Up @@ -559,18 +551,6 @@ namespace GfxRenderEngine
--availableQueues;
}
}
// transfer queue
if ((queueFamily.queueCount > 0) && (queueFamily.queueFlags & VK_QUEUE_TRANSFER_BIT) &&
(indices.m_TransferFamily == NO_ASSIGNED) && (availableQueues > 0))
{
if (indices.m_UniqueFamilyIndices[i] != i)
{
indices.m_UniqueFamilyIndices[uniqueIndices] = i;
++uniqueIndices;
}
++numberOfQueues;
indices.m_TransferFamily = i;
}

if (indices.IsComplete())
{
Expand Down Expand Up @@ -734,8 +714,8 @@ namespace GfxRenderEngine
std::lock_guard<std::mutex> guard(m_QueueAccessMutex);

{
vkQueueSubmit(TransferQueue(), 1, &submitInfo, VK_NULL_HANDLE);
vkQueueWaitIdle(TransferQueue());
vkQueueSubmit(GraphicsQueue(), 1, &submitInfo, VK_NULL_HANDLE);
vkQueueWaitIdle(GraphicsQueue());
vkFreeCommandBuffers(m_Device, m_LoadPool->GetCommandPool(), 1, &commandBuffer);
}
}
Expand Down
5 changes: 1 addition & 4 deletions engine/platform/Vulkan/VKdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ namespace GfxRenderEngine
VkSurfaceKHR Surface() { return m_Surface; }
VkQueue GraphicsQueue() { return m_GraphicsQueue; }
VkQueue PresentQueue() { return m_PresentQueue; }
VkQueue TransferQueue() { return m_TransfertQueue; }

SwapChainSupportDetails GetSwapChainSupport() { return QuerySwapChainSupport(m_PhysicalDevice); }
uint FindMemoryType(uint typeFilter, VkMemoryPropertyFlags properties);
Expand Down Expand Up @@ -88,7 +87,7 @@ namespace GfxRenderEngine
VkSampleCountFlagBits m_SampleCountFlagBits;

VkInstance GetInstance() const { return m_Instance; }
bool MultiThreadingSupport() const { return m_TransferQueueSupportsGraphics; }
bool MultiThreadingSupport() const { return true; }

private:
static constexpr int NO_ASSIGNED = -1;
Expand Down Expand Up @@ -132,7 +131,6 @@ namespace GfxRenderEngine

VkQueue m_GraphicsQueue;
VkQueue m_PresentQueue;
VkQueue m_TransfertQueue;

const std::vector<const char*> m_ValidationLayers = {"VK_LAYER_KHRONOS_validation"};
#ifdef MACOSX
Expand All @@ -141,6 +139,5 @@ namespace GfxRenderEngine
#else
const std::vector<const char*> m_RequiredDeviceExtensions = {VK_KHR_SWAPCHAIN_EXTENSION_NAME};
#endif
bool m_TransferQueueSupportsGraphics = false;
};
} // namespace GfxRenderEngine
2 changes: 1 addition & 1 deletion engine/platform/Vulkan/VKdeviceStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ namespace GfxRenderEngine
int m_NumberOfQueues = 0;
std::vector<int> m_UniqueFamilyIndices;
int m_QueueIndices[QueueTypes::NUMBER_OF_QUEUE_TYPES] = {};
bool IsComplete() { return (m_GraphicsFamily >= 0) && (m_PresentFamily >= 0) && (m_TransferFamily >= 0); }
bool IsComplete() { return (m_GraphicsFamily >= 0) && (m_PresentFamily >= 0); }
};
} // namespace GfxRenderEngine

0 comments on commit 396561c

Please sign in to comment.