Pārlūkot izejas kodu

* implemented pipeline layout

master
Bergmann89 pirms 10 gadiem
vecāks
revīzija
f487096c9d
7 mainītis faili ar 401 papildinājumiem un 122 dzēšanām
  1. +9
    -1
      projects/triangle/triangle.lpi
  2. +1
    -1
      projects/triangle/triangle.lpr
  3. +137
    -119
      projects/triangle/triangle.lps
  4. +10
    -1
      projects/utils/VulkanUtils.pas
  5. +84
    -0
      projects/utils/uvkuPipelineLayout.pas
  6. +158
    -0
      projects/utils/uvkuPipelineLayoutFactory.pas
  7. +2
    -0
      projects/utils/uvkuTypes.pas

+ 9
- 1
projects/triangle/triangle.lpi Parādīt failu

@@ -33,7 +33,7 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="37">
<Units Count="39">
<Unit0>
<Filename Value="triangle.lpr"/>
<IsPartOfProject Value="True"/>
@@ -185,6 +185,14 @@
<Filename Value="..\utils\uvkuDescriptorSetLayoutFactory.pas"/>
<IsPartOfProject Value="True"/>
</Unit36>
<Unit37>
<Filename Value="..\utils\uvkuPipelineLayout.pas"/>
<IsPartOfProject Value="True"/>
</Unit37>
<Unit38>
<Filename Value="..\utils\uvkuPipelineLayoutFactory.pas"/>
<IsPartOfProject Value="True"/>
</Unit38>
</Units>
</ProjectOptions>
<CompilerOptions>


+ 1
- 1
projects/triangle/triangle.lpr Parādīt failu

@@ -7,7 +7,7 @@ uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, Dialogs, Forms, uMainForm, Vulkan;
Interfaces, Dialogs, Forms, uMainForm, Vulkan, uvkuPipelineLayout, uvkuPipelineLayoutFactory;

{$R *.res}



+ 137
- 119
projects/triangle/triangle.lps Parādīt failu

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


+ 10
- 1
projects/utils/VulkanUtils.pas Parādīt failu

@@ -14,7 +14,9 @@ uses
uvkuImage, uvkuImageFactory, uvkuImageView, uvkuImageViewFactory,
uvkuBuffer, uvkuBufferFactory, uvkuBufferView, uvkuBufferViewFactory,
uvkuCommandPool, uvkuCommandPoolFactory, uvkuCommandBuffer,
uvkuRenderPass, uvkuRenderPassFactory, uvkuFrameBuffer, uvkuFrameBufferFactory,
uvkuRenderPass, uvkuRenderPassFactory,
uvkuFrameBuffer, uvkuFrameBufferFactory,
uvkuPipelineLayout, uvkuPipelineLayoutFactory,
uvkuUtils;

type
@@ -87,10 +89,17 @@ type
TvkuRenderPass = uvkuRenderPass.TvkuRenderPass;
TvkuRenderPassEx = uvkuRenderPassFactory.TvkuRenderPassEx;
TvkuRenderPassFactory = uvkuRenderPassFactory.TvkuRenderPassFactory;

{ FrameBuffer }
TvkuFrameBuffer = uvkuFrameBuffer.TvkuFrameBuffer;
TvkuFrameBufferEx = uvkuFrameBufferFactory.TvkuFrameBufferEx;
TvkuFrameBufferFactory = uvkuFrameBufferFactory.TvkuFrameBufferFactory;

{ Pipeline }
TvkuPipelineLayout = uvkuPipelineLayout.TvkuPipelineLayout;
TvkuPipelineLayoutEx = uvkuPipelineLayoutFactory.TvkuPipelineLayoutEx;
TvkuPipelineLayoutFactory = uvkuPipelineLayoutFactory.TvkuPipelineLayoutFactory;

{ Utils }
TvkuException = uvkuUtils.TvkuException;
TvkuErrorException = uvkuUtils.TvkuErrorException;


+ 84
- 0
projects/utils/uvkuPipelineLayout.pas Parādīt failu

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

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils,
Vulkan, uvkuBase;

type
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TvkuPipelineLayout = class(TvkuAllocHandle)
private
fHandle: VkPipelineLayout;
fDeviceCommands: TVkDeviceCommands;

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

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

implementation

uses
uvkuUtils;

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

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

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

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

end.


+ 158
- 0
projects/utils/uvkuPipelineLayoutFactory.pas Parādīt failu

@@ -0,0 +1,158 @@
unit uvkuPipelineLayoutFactory;

{$mode objfpc}{$H+}

interface

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

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

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TvkuPipelineLayoutFactory = class(TvkuDeviceObjFactory)
private
fFlags: VkPipelineLayoutCreateFlags;
fSetLayouts: TvkuDescriptorSetLayoutArr;
fPushConstantRanges: TvkuPushConstantRangeArr;

function GetPushConstantRange(const aIndex: Integer): TVkPushConstantRange;
function GetPushConstantRangeCount: Integer;
function GetSetLayout(const aIndex: Integer): VkDescriptorSetLayout;
function GetSetLayoutCount: Integer;
procedure SetPushConstantRange(const aIndex: Integer; aValue: TVkPushConstantRange);
procedure SetPushConstantRangeCount(aValue: Integer);
procedure SetSetLayout(const aIndex: Integer; aValue: VkDescriptorSetLayout);
procedure SetSetLayoutCount(aValue: Integer);
public
property Flags: VkPipelineLayoutCreateFlags read fFlags write fFlags;

property SetLayouts: TvkuDescriptorSetLayoutArr read fSetLayouts write fSetLayouts;
property SetLayoutCount: Integer read GetSetLayoutCount write SetSetLayoutCount;
property SetLayout[const aIndex: Integer]: VkDescriptorSetLayout read GetSetLayout write SetSetLayout;

property PushConstantRanges: TvkuPushConstantRangeArr read fPushConstantRanges write fPushConstantRanges;
property PushConstantRangeCount: Integer read GetPushConstantRangeCount write SetPushConstantRangeCount;
property PushConstantRange[const aIndex: Integer]: TVkPushConstantRange read GetPushConstantRange write SetPushConstantRange;

function CreatePipelineLayout: TvkuPipelineLayoutEx;
function CreatePipelineLayout(
const aAllocHandler: TvkuAllocationHandler;
const aOwnsHandler: Boolean): TvkuPipelineLayoutEx;
end;

implementation

uses
uvkuUtils;

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

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

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuPipelineLayoutFactory.GetPushConstantRangeCount: Integer;
begin
result := Length(fPushConstantRanges);
end;

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

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuPipelineLayoutFactory.GetSetLayoutCount: Integer;
begin
result := Length(fSetLayouts);
end;

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

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TvkuPipelineLayoutFactory.SetPushConstantRangeCount(aValue: Integer);
begin
SetLength(fPushConstantRanges, aValue);
end;

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

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TvkuPipelineLayoutFactory.SetSetLayoutCount(aValue: Integer);
begin
SetLength(fSetLayouts, aValue);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuPipelineLayoutFactory.CreatePipelineLayout: TvkuPipelineLayoutEx;
begin
result := CreatePipelineLayout(nil, false);
end;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TvkuPipelineLayoutFactory.CreatePipelineLayout(const aAllocHandler: TvkuAllocationHandler;
const aOwnsHandler: Boolean): TvkuPipelineLayoutEx;
var CreateInfo: TVkPipelineLayoutCreateInfo;
begin
FillByte(CreateInfo, SizeOf(CreateInfo), 0);
CreateInfo.sType := VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
CreateInfo.pNext := nil;
CreateInfo.flags := fFlags;
CreateInfo.setLayoutCount := Length(fSetLayouts);
CreateInfo.pSetLayouts := @fSetLayouts[0];
CreateInfo.pushConstantRangeCount := Length(fPushConstantRanges);
CreateInfo.pPushConstantRanges := @fPushConstantRanges[0];
if Assigned(aAllocHandler)
then result := TvkuPipelineLayoutEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr)
else result := TvkuPipelineLayoutEx.Create(CreateInfo, DeviceCommands);
try
TvkuPipelineLayoutEx(result).fAllocHandler := aAllocHandler;
TvkuPipelineLayoutEx(result).fOwnsHandler := aOwnsHandler;
except
FreeAndNil(result);
raise;
end;
end;

end.


+ 2
- 0
projects/utils/uvkuTypes.pas Parādīt failu

@@ -27,6 +27,8 @@ type
TvkuSubpassDependencyArr = array of TVkSubpassDependency;
TvkuImageViewArr = array of VkImageView;
TvkuDescriptorSetLayoutBindingArr = array of TVkDescriptorSetLayoutBinding;
TvkuDescriptorSetLayoutArr = array of VkDescriptorSetLayout;
TvkuPushConstantRangeArr = array of TVkPushConstantRange;

TvkuApplicationInfo = packed record
AppName: String;


Notiek ielāde…
Atcelt
Saglabāt