|
- unit uvkuDescriptorSet;
-
- {$mode objfpc}{$H+}
-
- interface
-
- uses
- Classes, SysUtils,
- Vulkan, uvkuBase;
-
- type
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TvkuDescriptorSet = class(TvkuHandle)
- private
- fHandle: VkDescriptorSet;
- fDescriptorPool: VkDescriptorPool;
- fDeviceCommands: TVkDeviceCommands;
- public
- property Handle: VkDescriptorSet read fHandle;
- property DescriptorPool: VkDescriptorPool read fDescriptorPool;
- property DeviceCommands: TVkDeviceCommands read fDeviceCommands;
-
- constructor Create(
- const aHandle: VkDescriptorSet;
- const aOwnsHandle: Boolean;
- const aDescriptorPool: VkDescriptorPool;
- const aDeviceCommands: TVkDeviceCommands);
- destructor Destroy; override;
- end;
-
- implementation
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //TvkuDescriptorSet//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- constructor TvkuDescriptorSet.Create(const aHandle: VkDescriptorSet; const aOwnsHandle: Boolean;
- const aDescriptorPool: VkDescriptorPool; const aDeviceCommands: TVkDeviceCommands);
- begin
- inherited Create;
- fHandle := aHandle;
- OwnsHandle := aOwnsHandle;
- fDescriptorPool := aDescriptorPool;
- fDeviceCommands := aDeviceCommands;
- end;
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- destructor TvkuDescriptorSet.Destroy;
- begin
- if (fHandle <> VK_INVALID_NDP_HANDLE) and OwnsHandle then
- fDeviceCommands.vkFreeDescriptorSets(fDeviceCommands.Device, fDescriptorPool, 1, @fHandle);
- fHandle := VK_INVALID_NDP_HANDLE;
- inherited Destroy;
- end;
-
- end.
|