| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #include "BsCommandBuffer.h"
- #include "BsCommandBufferManager.h"
- namespace BansheeEngine
- {
- void CommandSyncMask::addDependency(const SPtr<CommandBuffer>& buffer)
- {
- if (buffer == nullptr)
- return;
- mMask |= getGlobalQueueIdx(buffer->getType(), buffer->getQueueIdx());
- }
- UINT32 CommandSyncMask::getGlobalQueueIdx(GpuQueueType type, UINT32 queueIdx)
- {
- UINT32 bitShift = 0;
- switch (type)
- {
- case GQT_GRAPHICS:
- break;
- case GQT_COMPUTE:
- bitShift = 8;
- break;
- case GQT_UPLOAD:
- bitShift = 16;
- break;
- default:
- break;
- }
- return (1 << queueIdx) << bitShift;
- }
- CommandBuffer::CommandBuffer(GpuQueueType type, UINT32 deviceIdx, UINT32 queueIdx, bool secondary)
- :mType(type), mDeviceIdx(deviceIdx), mQueueIdx(queueIdx), mIsSecondary(secondary)
- {
- }
- SPtr<CommandBuffer> CommandBuffer::create(GpuQueueType type, UINT32 deviceIdx, UINT32 queueIdx,
- bool secondary)
- {
- return CommandBufferManager::instance().create(type, deviceIdx, queueIdx, secondary);
- }
- }
|