選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

56 行
2.2 KiB

  1. unit uvkuCommandPoolFactory;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils,
  6. Vulkan, uvkuCommandPool, uvkuFactoryBase;
  7. type
  8. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. TvkuCommandPoolFactory = class(TvkuDeviceObjFactory)
  10. private
  11. fFlags: VkCommandPoolCreateFlags;
  12. fQueueFamilyIndex: VkUint32;
  13. public
  14. property Flags: VkCommandPoolCreateFlags read fFlags write fFlags;
  15. property QueueFamilyIndex: VkUint32 read fQueueFamilyIndex write fQueueFamilyIndex;
  16. function GetStructure: TVkCommandPoolCreateInfo;
  17. procedure SetStructure(const aData: TVkCommandPoolCreateInfo);
  18. function CreateCommandPool: TvkuCommandPool;
  19. end;
  20. implementation
  21. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  22. //TvkuCommandPoolFactory/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  23. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  24. function TvkuCommandPoolFactory.GetStructure: TVkCommandPoolCreateInfo;
  25. begin
  26. FillByte(result, SizeOf(result), 0);
  27. result.sType := VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
  28. result.pNext := nil;
  29. result.flags := fFlags;
  30. result.queueFamilyIndex := fQueueFamilyIndex;
  31. end;
  32. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  33. procedure TvkuCommandPoolFactory.SetStructure(const aData: TVkCommandPoolCreateInfo);
  34. begin
  35. fFlags := aData.flags;
  36. fQueueFamilyIndex := aData.queueFamilyIndex;
  37. end;
  38. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  39. function TvkuCommandPoolFactory.CreateCommandPool: TvkuCommandPool;
  40. begin
  41. result := TvkuCommandPool.Create(GetStructure, DeviceCommands, AllocCallbacks);
  42. end;
  43. end.