unit uvkuCommandPoolFactory; {$mode objfpc}{$H+} interface uses Classes, SysUtils, Vulkan, uvkuCommandPool, uvkuFactoryBase; type ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TvkuCommandPoolFactory = class(TvkuDeviceObjFactory) private fFlags: VkCommandPoolCreateFlags; fQueueFamilyIndex: VkUint32; public property Flags: VkCommandPoolCreateFlags read fFlags write fFlags; property QueueFamilyIndex: VkUint32 read fQueueFamilyIndex write fQueueFamilyIndex; function GetStructure: TVkCommandPoolCreateInfo; procedure SetStructure(const aData: TVkCommandPoolCreateInfo); function CreateCommandPool: TvkuCommandPool; end; implementation ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //TvkuCommandPoolFactory///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function TvkuCommandPoolFactory.GetStructure: TVkCommandPoolCreateInfo; begin FillByte(result, SizeOf(result), 0); result.sType := VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; result.pNext := nil; result.flags := fFlags; result.queueFamilyIndex := fQueueFamilyIndex; end; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// procedure TvkuCommandPoolFactory.SetStructure(const aData: TVkCommandPoolCreateInfo); begin fFlags := aData.flags; fQueueFamilyIndex := aData.queueFamilyIndex; end; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function TvkuCommandPoolFactory.CreateCommandPool: TvkuCommandPool; begin result := TvkuCommandPool.Create(GetStructure, DeviceCommands, AllocCallbacks); end; end.