Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

57 строки
2.1 KiB

  1. unit uvkuDescriptorSet;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils,
  6. Vulkan, uvkuBase;
  7. type
  8. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. TvkuDescriptorSet = class(TvkuHandle)
  10. private
  11. fHandle: VkDescriptorSet;
  12. fDescriptorPool: VkDescriptorPool;
  13. fDeviceCommands: TVkDeviceCommands;
  14. public
  15. property Handle: VkDescriptorSet read fHandle;
  16. property DescriptorPool: VkDescriptorPool read fDescriptorPool;
  17. property DeviceCommands: TVkDeviceCommands read fDeviceCommands;
  18. constructor Create(
  19. const aHandle: VkDescriptorSet;
  20. const aOwnsHandle: Boolean;
  21. const aDescriptorPool: VkDescriptorPool;
  22. const aDeviceCommands: TVkDeviceCommands);
  23. destructor Destroy; override;
  24. end;
  25. implementation
  26. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  27. //TvkuDescriptorSet//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  28. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  29. constructor TvkuDescriptorSet.Create(const aHandle: VkDescriptorSet; const aOwnsHandle: Boolean;
  30. const aDescriptorPool: VkDescriptorPool; const aDeviceCommands: TVkDeviceCommands);
  31. begin
  32. inherited Create;
  33. fHandle := aHandle;
  34. OwnsHandle := aOwnsHandle;
  35. fDescriptorPool := aDescriptorPool;
  36. fDeviceCommands := aDeviceCommands;
  37. end;
  38. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  39. destructor TvkuDescriptorSet.Destroy;
  40. begin
  41. if (fHandle <> VK_INVALID_NDP_HANDLE) and OwnsHandle then
  42. fDeviceCommands.vkFreeDescriptorSets(fDeviceCommands.Device, fDescriptorPool, 1, @fHandle);
  43. fHandle := VK_INVALID_NDP_HANDLE;
  44. inherited Destroy;
  45. end;
  46. end.