|
- unit uvkuCommandBuffer;
-
- {$mode objfpc}{$H+}
-
- interface
-
- uses
- Classes, SysUtils,
- Vulkan, uvkuBase;
-
- type
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TvkuCommandBuffer = class(TvkuHandle)
- private
- fHandle: VkCommandBuffer;
- fCommandPool: VkCommandPool;
- fDeviceCommands: TVkDeviceCommands;
- public
- property Handle: VkCommandBuffer read fHandle;
- property CommandPool: VkCommandPool read fCommandPool;
- property DeviceCommands: TVkDeviceCommands read fDeviceCommands;
-
- constructor Create(
- const aHandle: VkCommandBuffer;
- const aOwnsHandle: Boolean;
- const aCommandPool: VkCommandPool;
- const aDeviceCommands: TVkDeviceCommands);
- destructor Destroy; override;
- end;
-
- implementation
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //TvkuCommandBuffer//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- constructor TvkuCommandBuffer.Create(const aHandle: VkCommandBuffer; const aOwnsHandle: Boolean;
- const aCommandPool: VkCommandPool; const aDeviceCommands: TVkDeviceCommands);
- begin
- inherited Create;
- fHandle := aHandle;
- fCommandPool := aCommandPool;
- fDeviceCommands := aDeviceCommands;
- OwnsHandle := aOwnsHandle;
- end;
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- destructor TvkuCommandBuffer.Destroy;
- begin
- if OwnsHandle and (fHandle <> VK_INVALID_HANDLE) then
- fDeviceCommands.vkFreeCommandBuffers(fDeviceCommands.Device, fCommandPool, 1, @fHandle);
- fHandle := VK_INVALID_HANDLE;
- inherited Destroy;
- end;
-
- end.
|