BsCommandBuffer.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsCommandBuffer.h"
  4. #include "BsCommandBufferManager.h"
  5. namespace BansheeEngine
  6. {
  7. void CommandSyncMask::addDependency(const SPtr<CommandBuffer>& buffer)
  8. {
  9. if (buffer == nullptr)
  10. return;
  11. mMask |= 1 << buffer->_getId();
  12. }
  13. CommandBuffer::CommandBuffer(UINT32 id, CommandBufferType type, UINT32 deviceIdx, UINT32 queueIdx, bool secondary)
  14. :mId(id), mType(type), mDeviceIdx(deviceIdx), mQueueIdx(queueIdx), mIsSecondary(secondary)
  15. {
  16. }
  17. CommandBuffer::~CommandBuffer()
  18. {
  19. CommandBufferManager::instance().notifyCommandBufferDestroyed(mDeviceIdx, mId);
  20. }
  21. SPtr<CommandBuffer> CommandBuffer::create(CommandBufferType type, UINT32 deviceIdx, UINT32 queueIdx,
  22. bool secondary)
  23. {
  24. return CommandBufferManager::instance().create(type, deviceIdx, queueIdx, secondary);
  25. }
  26. }