Przeglądaj źródła

* implemented descriptor set layout

master
Bergmann89 10 lat temu
rodzic
commit
1eb5653fc5
15 zmienionych plików z 388 dodań i 142 usunięć
  1. +9
    -1
      projects/triangle/triangle.lpi
  2. +1
    -2
      projects/triangle/triangle.lpr
  3. +165
    -130
      projects/triangle/triangle.lps
  4. +1
    -1
      projects/utils/uvkuBufferFactory.pas
  5. +1
    -1
      projects/utils/uvkuBufferViewFactory.pas
  6. +1
    -1
      projects/utils/uvkuCommandPoolFactory.pas
  7. +84
    -0
      projects/utils/uvkuDescriptorSetLayout.pas
  8. +119
    -0
      projects/utils/uvkuDescriptorSetLayoutFactory.pas
  9. +1
    -1
      projects/utils/uvkuDeviceFactory.pas
  10. +1
    -1
      projects/utils/uvkuImageFactory.pas
  11. +1
    -1
      projects/utils/uvkuImageViewFactory.pas
  12. +1
    -1
      projects/utils/uvkuSurfaceFactory.pas
  13. +1
    -1
      projects/utils/uvkuSwapChainFactory.pas
  14. +1
    -0
      projects/utils/uvkuTypes.pas
  15. +1
    -1
      projects/utils/uvkuUtils.pas

+ 9
- 1
projects/triangle/triangle.lpi Wyświetl plik

@@ -33,7 +33,7 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="35">
<Units Count="37">
<Unit0>
<Filename Value="triangle.lpr"/>
<IsPartOfProject Value="True"/>
@@ -177,6 +177,14 @@
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<IsPartOfProject Value="True"/>
</Unit34>
<Unit35>
<Filename Value="..\utils\uvkuDescriptorSetLayout.pas"/>
<IsPartOfProject Value="True"/>
</Unit35>
<Unit36>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<IsPartOfProject Value="True"/>
</Unit36>
</Units>
</ProjectOptions>
<CompilerOptions>


+ 1
- 2
projects/triangle/triangle.lpr Wyświetl plik

@@ -7,8 +7,7 @@ uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, Dialogs, Forms, uMainForm, Vulkan, uvkuRenderPass, uvkuRenderPassFactory, uvkuFactoryBase,
uvkuFrameBuffer, uvkuFrameBufferFactory, uvkuUtils;
Interfaces, Dialogs, Forms, uMainForm, Vulkan;

{$R *.res}



+ 165
- 130
projects/triangle/triangle.lps Wyświetl plik

@@ -4,13 +4,15 @@
<PathDelim Value="\"/>
<Version Value="9"/>
<BuildModes Active="Default"/>
<Units Count="53">
<Units Count="55">
<Unit0>
<Filename Value="triangle.lpr"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="5"/>
<CursorPos X="48" Y="10"/>
<UsageCount Value="68"/>
<UsageCount Value="69"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="uMainForm.pas"/>
@@ -21,21 +23,21 @@
<EditorIndex Value="-1"/>
<TopLine Value="53"/>
<CursorPos X="150" Y="70"/>
<UsageCount Value="68"/>
<UsageCount Value="69"/>
</Unit1>
<Unit2>
<Filename Value="..\Vulkan.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="6"/>
<TopLine Value="2765"/>
<CursorPos X="72" Y="2784"/>
<EditorIndex Value="9"/>
<TopLine Value="2674"/>
<CursorPos X="32" Y="2682"/>
<ExtraEditorCount Value="1"/>
<ExtraEditor1>
<EditorIndex Value="-1"/>
<TopLine Value="2785"/>
<CursorPos X="3" Y="2800"/>
</ExtraEditor1>
<UsageCount Value="68"/>
<UsageCount Value="69"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
@@ -43,7 +45,7 @@
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<CursorPos X="30" Y="9"/>
<UsageCount Value="66"/>
<UsageCount Value="67"/>
</Unit3>
<Unit4>
<Filename Value="..\utils\uvkuInstanceFactory.pas"/>
@@ -51,7 +53,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="19"/>
<CursorPos X="3" Y="161"/>
<UsageCount Value="60"/>
<UsageCount Value="61"/>
</Unit4>
<Unit5>
<Filename Value="..\utils\uvkuPhysicalDevice.pas"/>
@@ -59,7 +61,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="245"/>
<CursorPos X="38" Y="252"/>
<UsageCount Value="60"/>
<UsageCount Value="61"/>
</Unit5>
<Unit6>
<Filename Value="..\utils\uvkuAllocationHandler.pas"/>
@@ -67,7 +69,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="91"/>
<CursorPos X="39" Y="99"/>
<UsageCount Value="50"/>
<UsageCount Value="51"/>
</Unit6>
<Unit7>
<Filename Value="..\utils\uvkuDevice.pas"/>
@@ -75,15 +77,14 @@
<EditorIndex Value="-1"/>
<TopLine Value="51"/>
<CursorPos X="63" Y="66"/>
<UsageCount Value="54"/>
<UsageCount Value="55"/>
</Unit7>
<Unit8>
<Filename Value="..\utils\uvkuDeviceFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="8"/>
<TopLine Value="118"/>
<CursorPos X="39" Y="123"/>
<UsageCount Value="52"/>
<EditorIndex Value="11"/>
<CursorPos X="11" Y="9"/>
<UsageCount Value="53"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
@@ -92,23 +93,23 @@
<EditorIndex Value="-1"/>
<TopLine Value="41"/>
<CursorPos X="94" Y="56"/>
<UsageCount Value="47"/>
<UsageCount Value="48"/>
</Unit9>
<Unit10>
<Filename Value="..\utils\uvkuSurfaceFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="34"/>
<CursorPos X="43" Y="47"/>
<UsageCount Value="46"/>
<EditorIndex Value="12"/>
<CursorPos X="11" Y="10"/>
<UsageCount Value="47"/>
<Loaded Value="True"/>
</Unit10>
<Unit11>
<Filename Value="..\utils\uvkuSwapChainFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="51"/>
<CursorPos X="14" Y="64"/>
<UsageCount Value="37"/>
<EditorIndex Value="13"/>
<CursorPos X="60" Y="9"/>
<UsageCount Value="38"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
<Filename Value="..\utils\uvkuSwapChain.pas"/>
@@ -116,7 +117,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="62"/>
<CursorPos X="35" Y="78"/>
<UsageCount Value="36"/>
<UsageCount Value="37"/>
</Unit12>
<Unit13>
<Filename Value="..\utils\uvkuImageView.pas"/>
@@ -124,15 +125,15 @@
<EditorIndex Value="-1"/>
<TopLine Value="29"/>
<CursorPos X="64" Y="47"/>
<UsageCount Value="33"/>
<UsageCount Value="34"/>
</Unit13>
<Unit14>
<Filename Value="..\utils\uvkuImageViewFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="60"/>
<CursorPos X="55" Y="79"/>
<UsageCount Value="33"/>
<EditorIndex Value="15"/>
<CursorPos X="49" Y="9"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit14>
<Unit15>
<Filename Value="..\utils\uvkuImage.pas"/>
@@ -140,7 +141,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="36"/>
<CursorPos X="102" Y="51"/>
<UsageCount Value="32"/>
<UsageCount Value="33"/>
</Unit15>
<Unit16>
<Filename Value="..\utils\uvkuBase.pas"/>
@@ -148,7 +149,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="26"/>
<CursorPos X="5" Y="39"/>
<UsageCount Value="31"/>
<UsageCount Value="32"/>
</Unit16>
<Unit17>
<Filename Value="..\utils\uvkuDeviceMemory.pas"/>
@@ -156,7 +157,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="33"/>
<CursorPos X="79" Y="44"/>
<UsageCount Value="29"/>
<UsageCount Value="30"/>
</Unit17>
<Unit18>
<Filename Value="..\utils\uvkuBuffer.pas"/>
@@ -164,32 +165,32 @@
<EditorIndex Value="-1"/>
<TopLine Value="10"/>
<CursorPos X="3" Y="13"/>
<UsageCount Value="28"/>
<UsageCount Value="29"/>
</Unit18>
<Unit19>
<Filename Value="..\utils\uvkuImageFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="113"/>
<CursorPos X="51" Y="132"/>
<UsageCount Value="28"/>
<EditorIndex Value="14"/>
<CursorPos X="22" Y="9"/>
<UsageCount Value="29"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="..\utils\uvkuTypes.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="7"/>
<TopLine Value="18"/>
<CursorPos X="12" Y="44"/>
<UsageCount Value="28"/>
<EditorIndex Value="10"/>
<TopLine Value="15"/>
<CursorPos X="36" Y="29"/>
<UsageCount Value="29"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="..\utils\uvkuBufferFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="92"/>
<CursorPos X="52" Y="111"/>
<UsageCount Value="27"/>
<EditorIndex Value="16"/>
<CursorPos X="23" Y="9"/>
<UsageCount Value="28"/>
<Loaded Value="True"/>
</Unit21>
<Unit22>
<Filename Value="..\utils\uvkuBufferView.pas"/>
@@ -197,38 +198,39 @@
<EditorIndex Value="-1"/>
<TopLine Value="52"/>
<CursorPos X="56" Y="76"/>
<UsageCount Value="27"/>
<UsageCount Value="28"/>
</Unit22>
<Unit23>
<Filename Value="..\utils\uvkuBufferViewFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="59"/>
<CursorPos X="56" Y="78"/>
<UsageCount Value="26"/>
<EditorIndex Value="17"/>
<CursorPos X="50" Y="9"/>
<UsageCount Value="27"/>
<Loaded Value="True"/>
</Unit23>
<Unit24>
<Filename Value="..\utils\uvkuCommandPool.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="57"/>
<CursorPos X="62" Y="68"/>
<UsageCount Value="26"/>
<EditorIndex Value="18"/>
<TopLine Value="58"/>
<CursorPos X="34" Y="78"/>
<UsageCount Value="27"/>
<Loaded Value="True"/>
</Unit24>
<Unit25>
<Filename Value="..\utils\uvkuCommandPoolFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="45"/>
<CursorPos X="57" Y="64"/>
<UsageCount Value="25"/>
<EditorIndex Value="19"/>
<CursorPos X="28" Y="9"/>
<UsageCount Value="26"/>
<Loaded Value="True"/>
</Unit25>
<Unit26>
<Filename Value="..\utils\uvkuCommandBuffer.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<CursorPos X="39" Y="13"/>
<UsageCount Value="25"/>
<UsageCount Value="26"/>
</Unit26>
<Unit27>
<Filename Value="..\utils\uvkuQueue.pas"/>
@@ -236,16 +238,15 @@
<EditorIndex Value="-1"/>
<TopLine Value="7"/>
<CursorPos X="22" Y="23"/>
<UsageCount Value="25"/>
<UsageCount Value="26"/>
</Unit27>
<Unit28>
<Filename Value="..\utils\VulkanUtils.pas"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
<TopLine Value="64"/>
<CursorPos X="80" Y="94"/>
<UsageCount Value="24"/>
<TopLine Value="67"/>
<CursorPos X="37" Y="86"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit28>
<Unit29>
@@ -258,8 +259,9 @@
<Unit30>
<Filename Value="..\utils\uvkuUtils.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="4"/>
<TopLine Value="9"/>
<EditorIndex Value="7"/>
<TopLine Value="17"/>
<CursorPos X="28" Y="29"/>
<UsageCount Value="42"/>
<Loaded Value="True"/>
</Unit30>
@@ -391,7 +393,7 @@
<EditorIndex Value="1"/>
<TopLine Value="8"/>
<CursorPos X="150" Y="12"/>
<UsageCount Value="22"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit48>
<Unit49>
@@ -399,7 +401,7 @@
<IsPartOfProject Value="True"/>
<TopLine Value="122"/>
<CursorPos Y="139"/>
<UsageCount Value="22"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit49>
<Unit50>
@@ -407,132 +409,165 @@
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="7"/>
<UsageCount Value="22"/>
<UsageCount Value="23"/>
</Unit50>
<Unit51>
<Filename Value="..\utils\uvkuFrameBuffer.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="3"/>
<EditorIndex Value="6"/>
<TopLine Value="33"/>
<CursorPos Y="12"/>
<CursorPos X="150" Y="40"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit51>
<Unit52>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="5"/>
<TopLine Value="96"/>
<CursorPos Y="118"/>
<EditorIndex Value="8"/>
<TopLine Value="67"/>
<CursorPos Y="85"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit52>
<Unit53>
<Filename Value="..\utils\uvkuDescriptorSetLayout.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="3"/>
<CursorPos X="29"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit53>
<Unit54>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="4"/>
<TopLine Value="86"/>
<CursorPos X="14" Y="105"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit54>
</Units>
<JumpHistory Count="26" HistoryIndex="25">
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="40" TopLine="13"/>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="41" Column="100" TopLine="14"/>
</Position1>
<Position2>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="26" Column="37"/>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="121" Column="60" TopLine="46"/>
</Position2>
<Position3>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="32" TopLine="18"/>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="54" Column="13" TopLine="39"/>
</Position3>
<Position4>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="57" Column="3" TopLine="28"/>
<Filename Value="..\utils\uvkuFrameBuffer.pas"/>
<Caret Line="12" TopLine="33"/>
</Position4>
<Position5>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="62" Column="20" TopLine="43"/>
<Filename Value="..\utils\VulkanUtils.pas"/>
<Caret Line="18" Column="12"/>
</Position5>
<Position6>
<Filename Value="..\utils\uvkuDeviceFactory.pas"/>
<Caret Line="58" Column="43" TopLine="46"/>
<Filename Value="..\utils\uvkuDescriptorSetLayout.pas"/>
<Caret Line="24" Column="12" TopLine="8"/>
</Position6>
<Position7>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="62" Column="20" TopLine="43"/>
<Filename Value="..\utils\uvkuDescriptorSetLayout.pas"/>
<Caret Line="77" Column="29" TopLine="47"/>
</Position7>
<Position8>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="35" TopLine="21"/>
<Filename Value="triangle.lpr"/>
<Caret Line="10" Column="48"/>
</Position8>
<Position9>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="98" Column="49" TopLine="77"/>
<Filename Value="..\utils\uvkuUtils.pas"/>
<Caret TopLine="9"/>
</Position9>
<Position10>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="33" Column="49" TopLine="27"/>
<Filename Value="..\utils\uvkuDeviceFactory.pas"/>
<Caret Line="123" Column="39" TopLine="118"/>
</Position10>
<Position11>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="55" Column="109" TopLine="44"/>
<Filename Value="..\utils\uvkuDeviceFactory.pas"/>
<Caret Line="172" Column="22" TopLine="157"/>
</Position11>
<Position12>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="186" TopLine="150"/>
<Filename Value="..\utils\uvkuSurfaceFactory.pas"/>
<Caret Line="47" Column="43" TopLine="34"/>
</Position12>
<Position13>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="9" Column="67"/>
<Filename Value="..\utils\uvkuSwapChainFactory.pas"/>
<Caret Line="64" Column="14" TopLine="51"/>
</Position13>
<Position14>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="190" Column="53" TopLine="170"/>
<Filename Value="..\utils\uvkuImageFactory.pas"/>
<Caret Line="132" Column="51" TopLine="113"/>
</Position14>
<Position15>
<Filename Value="..\utils\uvkuRenderPassFactory.pas"/>
<Caret Line="188" Column="70" TopLine="170"/>
<Filename Value="..\utils\uvkuImageViewFactory.pas"/>
<Caret Line="79" Column="55" TopLine="60"/>
</Position15>
<Position16>
<Filename Value="..\utils\uvkuFrameBuffer.pas"/>
<Caret Line="30" Column="14" TopLine="8"/>
<Filename Value="..\utils\uvkuBufferFactory.pas"/>
<Caret Line="111" Column="52" TopLine="92"/>
</Position16>
<Position17>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="30" Column="34"/>
<Filename Value="..\utils\uvkuBufferViewFactory.pas"/>
<Caret Line="78" Column="56" TopLine="59"/>
</Position17>
<Position18>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="16" Column="40" TopLine="8"/>
<Filename Value="..\utils\uvkuCommandPool.pas"/>
<Caret Line="68" Column="62" TopLine="57"/>
</Position18>
<Position19>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="60" Column="14" TopLine="31"/>
<Filename Value="..\utils\uvkuCommandPoolFactory.pas"/>
<Caret Line="64" Column="57" TopLine="45"/>
</Position19>
<Position20>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="57" Column="3" TopLine="34"/>
<Filename Value="..\utils\uvkuCommandPool.pas"/>
<Caret Line="73" Column="21" TopLine="58"/>
</Position20>
<Position21>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="66" Column="29" TopLine="44"/>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="17" Column="34"/>
</Position21>
<Position22>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="41" Column="100" TopLine="14"/>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="28" Column="63" TopLine="4"/>
</Position22>
<Position23>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="121" Column="60" TopLine="46"/>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="32" TopLine="14"/>
</Position23>
<Position24>
<Filename Value="..\utils\uvkuFrameBufferFactory.pas"/>
<Caret Line="54" Column="13" TopLine="39"/>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="58" Column="3" TopLine="28"/>
</Position24>
<Position25>
<Filename Value="..\utils\uvkuFrameBuffer.pas"/>
<Caret Line="12" TopLine="33"/>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="57" Column="3" TopLine="36"/>
</Position25>
<Position26>
<Filename Value="..\utils\VulkanUtils.pas"/>
<Caret Line="18" Column="12"/>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="9" Column="85"/>
</Position26>
<Position27>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="35" Column="109" TopLine="13"/>
</Position27>
<Position28>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="108" Column="69" TopLine="79"/>
</Position28>
<Position29>
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<Caret Line="46" Column="13" TopLine="26"/>
</Position29>
<Position30>
<Filename Value="triangle.lpr"/>
<Caret Line="10" Column="80"/>
</Position30>
</JumpHistory>
</ProjectSession>
<Debugging>


+ 1
- 1
projects/utils/uvkuBufferFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuBuffer, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase;
Vulkan, uvkuBuffer, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 1
projects/utils/uvkuBufferViewFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuBufferView, uvkuAllocationHandler, uvkuDevice, uvkuFactoryBase;
Vulkan, uvkuBufferView, uvkuAllocationHandler, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 1
projects/utils/uvkuCommandPoolFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuCommandPool, uvkuDevice, uvkuAllocationHandler, uvkuFactoryBase;
Vulkan, uvkuCommandPool, uvkuAllocationHandler, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 84
- 0
projects/utils/uvkuDescriptorSetLayout.pas Wyświetl plik

@@ -0,0 +1,84 @@
unit uvkuDescriptorSetLayout;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils,
Vulkan, uvkuBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TvkuDescriptorSetLayout = class(TvkuAllocHandle)
private
fHandle: VkDescriptorSetLayout;
fDeviceCommands: TVkDeviceCommands;

procedure CreateHandle(const aCreateInfo: TVkDescriptorSetLayoutCreateInfo);
public
property Handle: VkDescriptorSetLayout read fHandle;
property DeviceCommands: TVkDeviceCommands read fDeviceCommands;

constructor Create(
const aCreateInfo: TVkDescriptorSetLayoutCreateInfo;
const aDeviceCommands: TVkDeviceCommands;
const aAllocCallbacks: PVkAllocationCallbacks = nil);
constructor Create(
const aHandle: VkDescriptorSetLayout;
const aOwnsHandle: Boolean;
const aDeviceCommands: TVkDeviceCommands;
const aAllocCallbacks: PVkAllocationCallbacks = nil);
destructor Destroy; override;
end;

implementation

uses
uvkuUtils;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TvkuDescriptorSetLayout////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TvkuDescriptorSetLayout.CreateHandle(const aCreateInfo: TVkDescriptorSetLayoutCreateInfo);
var err: TVkResult;
begin
if not Assigned(fDeviceCommands.vkCreateDescriptorSetLayout) then
raise TvkuInvalidFuncPtrException.Create('vkCreateDescriptorSetLayout');
err := fDeviceCommands.vkCreateDescriptorSetLayout(fDeviceCommands.Device, @aCreateInfo, AllocCallbacks, @fHandle);
if (err < VK_SUCCESS) then
raise TvkuErrorException.Create('unable to create descriptor set layout', err);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
constructor TvkuDescriptorSetLayout.Create(const aCreateInfo: TVkDescriptorSetLayoutCreateInfo;
const aDeviceCommands: TVkDeviceCommands; const aAllocCallbacks: PVkAllocationCallbacks);
begin
inherited Create;
fDeviceCommands := aDeviceCommands;
SetAllocCallbacks(aAllocCallbacks);
CreateHandle(aCreateInfo);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
constructor TvkuDescriptorSetLayout.Create(const aHandle: VkDescriptorSetLayout; const aOwnsHandle: Boolean;
const aDeviceCommands: TVkDeviceCommands; const aAllocCallbacks: PVkAllocationCallbacks);
begin
inherited Create;
fHandle := aHandle;
fDeviceCommands := aDeviceCommands;
OwnsHandle := aOwnsHandle;
SetAllocCallbacks(aAllocCallbacks);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
destructor TvkuDescriptorSetLayout.Destroy;
begin
if OwnsHandle and (fHandle <> VK_INVALID_NDP_HANDLE) then
fDeviceCommands.vkDestroyDescriptorSetLayout(fDeviceCommands.Device, fHandle, AllocCallbacks);
fHandle := VK_INVALID_NDP_HANDLE;
inherited Destroy;
end;

end.


+ 119
- 0
projects/utils/uvkuDescriptorSetLayoutFactory.pas Wyświetl plik

@@ -0,0 +1,119 @@
unit uvkuDescriptorSetLayoutFactory;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils,
Vulkan, uvkuFactoryBase, uvkuDescriptorSetLayout, uvkuAllocationHandler, uvkuTypes;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TvkuDescriptorSetLayoutEx = class(TvkuDescriptorSetLayout)
private
fAllocHandler: TvkuAllocationHandler;
fOwnsHandler: Boolean;
public
destructor Destroy; override;
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TvkuDescriptorSetLayoutFactory = class(TvkuDeviceObjFactory)
private
fFlags: VkDescriptorSetLayoutCreateFlags;
fBindings: TvkuDescriptorSetLayoutBindingArr;
function GetBinding(const aIndex: Integer): TVkDescriptorSetLayoutBinding;
function GetBindingCount: Integer;
procedure SetBinding(const aIndex: Integer; aValue: TVkDescriptorSetLayoutBinding);
procedure SetBindingCount(aValue: Integer);
public
property Flags: VkDescriptorSetLayoutCreateFlags read fFlags write fFlags;

property Bindings: TvkuDescriptorSetLayoutBindingArr read fBindings write fBindings;
property BindingCount: Integer read GetBindingCount write SetBindingCount;
property Binding[const aIndex: Integer]: TVkDescriptorSetLayoutBinding read GetBinding write SetBinding;

function CreateDescriptorSetLayout: TvkuDescriptorSetLayoutEx;
function CreateDescriptorSetLayout(
const aAllocHandler: TvkuAllocationHandler;
const aOwnsHandler: Boolean): TvkuDescriptorSetLayoutEx;
end;

implementation

uses
uvkuUtils;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TvkuDescriptorSetLayoutEx//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
destructor TvkuDescriptorSetLayoutEx.Destroy;
begin
inherited Destroy;
if fOwnsHandler then
FreeAndNil(fAllocHandler);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TvkuDescriptorSetLayoutFactory/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuDescriptorSetLayoutFactory.GetBinding(const aIndex: Integer): TVkDescriptorSetLayoutBinding;
begin
if (aIndex < low(fBindings)) or (aIndex > high(fBindings)) then
raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fBindings), High(fBindings)]);
result := fBindings[aIndex];
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuDescriptorSetLayoutFactory.GetBindingCount: Integer;
begin
result := Length(fBindings);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TvkuDescriptorSetLayoutFactory.SetBinding(const aIndex: Integer; aValue: TVkDescriptorSetLayoutBinding);
begin
if (aIndex < low(fBindings)) or (aIndex > high(fBindings)) then
raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fBindings), High(fBindings)]);
fBindings[aIndex] := aValue;
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TvkuDescriptorSetLayoutFactory.SetBindingCount(aValue: Integer);
begin
SetLength(fBindings, aValue);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuDescriptorSetLayoutFactory.CreateDescriptorSetLayout: TvkuDescriptorSetLayoutEx;
begin
result := CreateDescriptorSetLayout(nil, false);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuDescriptorSetLayoutFactory.CreateDescriptorSetLayout(const aAllocHandler: TvkuAllocationHandler;
const aOwnsHandler: Boolean): TvkuDescriptorSetLayoutEx;
var
CreateInfo: TVkDescriptorSetLayoutCreateInfo;
begin
FillByte(CreateInfo, SizeOf(CreateInfo), 0);
CreateInfo.sType := VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
CreateInfo.pNext := nil;
CreateInfo.flags := fFlags;
CreateInfo.bindingCount := Length(fBindings);
CreateInfo.pBindings := @fBindings[0];
if Assigned(aAllocHandler)
then result := TvkuDescriptorSetLayoutEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr)
else result := TvkuDescriptorSetLayoutEx.Create(CreateInfo, DeviceCommands);
try
TvkuDescriptorSetLayoutEx(result).fAllocHandler := aAllocHandler;
TvkuDescriptorSetLayoutEx(result).fOwnsHandler := aOwnsHandler;
except
FreeAndNil(result);
raise;
end;
end;

end.


+ 1
- 1
projects/utils/uvkuDeviceFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuInstance, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase;
Vulkan, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 1
projects/utils/uvkuImageFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuImage, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase;
Vulkan, uvkuImage, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 1
projects/utils/uvkuImageViewFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuAllocationHandler, uvkuImageView, uvkuDevice, uvkuFactoryBase;
Vulkan, uvkuAllocationHandler, uvkuImageView, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 1
projects/utils/uvkuSurfaceFactory.pas Wyświetl plik

@@ -7,7 +7,7 @@ interface

uses
Classes, SysUtils, Controls,
Vulkan, uvkuInstance, uvkuSurface, uvkuAllocationHandler, uvkuFactoryBase;
Vulkan, uvkuSurface, uvkuAllocationHandler, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 1
projects/utils/uvkuSwapChainFactory.pas Wyświetl plik

@@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils,
Vulkan, uvkuSwapChain, uvkuTypes, uvkuAllocationHandler, uvkuDevice, uvkuFactoryBase;
Vulkan, uvkuSwapChain, uvkuTypes, uvkuAllocationHandler, uvkuFactoryBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


+ 1
- 0
projects/utils/uvkuTypes.pas Wyświetl plik

@@ -26,6 +26,7 @@ type
TvkuSubpassDescriptionArr = array of TVkSubpassDescription;
TvkuSubpassDependencyArr = array of TVkSubpassDependency;
TvkuImageViewArr = array of VkImageView;
TvkuDescriptorSetLayoutBindingArr = array of TVkDescriptorSetLayoutBinding;

TvkuApplicationInfo = packed record
AppName: String;


+ 1
- 1
projects/utils/uvkuUtils.pas Wyświetl plik

@@ -26,7 +26,7 @@ type
fFunctionName: String;
fExtentionName: String;
public
property FunctionName: String read fFunctionName;
property FunctionName: String read fFunctionName;
property ExtensionName: String read fExtensionName;

constructor Create(const aFunctionName: String; const aExtensionName: String = '');


Ładowanie…
Anuluj
Zapisz