Skip to content

Commit

Permalink
Vulkan: range loop refactoring (#2959)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joilnen authored and paroj committed Oct 25, 2023
1 parent 96bd0e7 commit edc97b2
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions RenderSystems/Vulkan/src/OgreVulkanDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,8 @@ namespace Ogre
//-------------------------------------------------------------------------
void VulkanDevice::destroyQueues( FastArray<VulkanQueue> &queueArray )
{
FastArray<VulkanQueue>::iterator itor = queueArray.begin();
FastArray<VulkanQueue>::iterator endt = queueArray.end();

while( itor != endt )
{
itor->destroy();
++itor;
}
for (auto& q : queueArray)
q.destroy();
queueArray.clear();
}
//-------------------------------------------------------------------------
Expand Down Expand Up @@ -304,24 +298,16 @@ namespace Ogre
vkGetDeviceQueue( mDevice, mGraphicsQueue.mFamilyIdx, mGraphicsQueue.mQueueIdx, &queue );
mGraphicsQueue.init( mDevice, queue, mRenderSystem );

FastArray<VulkanQueue>::iterator itor = mComputeQueues.begin();
FastArray<VulkanQueue>::iterator endt = mComputeQueues.end();

while( itor != endt )
for (auto& q : mComputeQueues)
{
vkGetDeviceQueue( mDevice, itor->mFamilyIdx, itor->mQueueIdx, &queue );
itor->init( mDevice, queue, mRenderSystem );
++itor;
vkGetDeviceQueue( mDevice, q.mFamilyIdx, q.mQueueIdx, &queue);
q.init(mDevice, queue, mRenderSystem);
}

itor = mTransferQueues.begin();
endt = mTransferQueues.end();

while( itor != endt )
for (auto& q : mTransferQueues)
{
vkGetDeviceQueue( mDevice, itor->mFamilyIdx, itor->mQueueIdx, &queue );
itor->init( mDevice, queue, mRenderSystem );
++itor;
vkGetDeviceQueue(mDevice, q.mFamilyIdx, q.mQueueIdx, &queue);
q.init(mDevice, queue, mRenderSystem);
}

TODO_findRealPresentQueue;
Expand Down

0 comments on commit edc97b2

Please sign in to comment.