| @@ -33,7 +33,7 @@ | |||
| <PackageName Value="LCL"/> | |||
| </Item1> | |||
| </RequiredPackages> | |||
| <Units Count="29"> | |||
| <Units Count="32"> | |||
| <Unit0> | |||
| <Filename Value="triangle.lpr"/> | |||
| <IsPartOfProject Value="True"/> | |||
| @@ -153,6 +153,18 @@ | |||
| <Filename Value="..\utils\VulkanUtils.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| </Unit28> | |||
| <Unit29> | |||
| <Filename Value="..\utils\uvkuRenderPass.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| </Unit29> | |||
| <Unit30> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| </Unit30> | |||
| <Unit31> | |||
| <Filename Value="..\utils\uvkuFactoryBase.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| </Unit31> | |||
| </Units> | |||
| </ProjectOptions> | |||
| <CompilerOptions> | |||
| @@ -7,7 +7,7 @@ uses | |||
| {$IFDEF UNIX}{$IFDEF UseCThreads} | |||
| cthreads, | |||
| {$ENDIF}{$ENDIF} | |||
| Interfaces, Dialogs, Forms, uMainForm, Vulkan; | |||
| Interfaces, Dialogs, Forms, uMainForm, Vulkan, uvkuRenderPass, uvkuRenderPassFactory, uvkuFactoryBase; | |||
| {$R *.res} | |||
| @@ -4,13 +4,13 @@ | |||
| <PathDelim Value="\"/> | |||
| <Version Value="9"/> | |||
| <BuildModes Active="Default"/> | |||
| <Units Count="48"> | |||
| <Units Count="51"> | |||
| <Unit0> | |||
| <Filename Value="triangle.lpr"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <CursorPos X="48" Y="10"/> | |||
| <UsageCount Value="66"/> | |||
| <UsageCount Value="67"/> | |||
| </Unit0> | |||
| <Unit1> | |||
| <Filename Value="uMainForm.pas"/> | |||
| @@ -18,24 +18,24 @@ | |||
| <ComponentName Value="MainForm"/> | |||
| <HasResources Value="True"/> | |||
| <ResourceBaseClass Value="Form"/> | |||
| <TopLine Value="121"/> | |||
| <CursorPos X="33" Y="177"/> | |||
| <UsageCount Value="66"/> | |||
| <Loaded Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="53"/> | |||
| <CursorPos X="150" Y="70"/> | |||
| <UsageCount Value="67"/> | |||
| </Unit1> | |||
| <Unit2> | |||
| <Filename Value="..\Vulkan.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="9"/> | |||
| <TopLine Value="1301"/> | |||
| <CursorPos X="3" Y="1316"/> | |||
| <EditorIndex Value="2"/> | |||
| <TopLine Value="2819"/> | |||
| <CursorPos X="23" Y="2825"/> | |||
| <ExtraEditorCount Value="1"/> | |||
| <ExtraEditor1> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="2048"/> | |||
| <CursorPos X="17" Y="2064"/> | |||
| <TopLine Value="2785"/> | |||
| <CursorPos X="3" Y="2800"/> | |||
| </ExtraEditor1> | |||
| <UsageCount Value="66"/> | |||
| <UsageCount Value="67"/> | |||
| <Loaded Value="True"/> | |||
| </Unit2> | |||
| <Unit3> | |||
| @@ -43,24 +43,23 @@ | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <CursorPos X="30" Y="9"/> | |||
| <UsageCount Value="64"/> | |||
| <UsageCount Value="65"/> | |||
| </Unit3> | |||
| <Unit4> | |||
| <Filename Value="..\utils\uvkuInstanceFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="29"/> | |||
| <CursorPos X="3" Y="23"/> | |||
| <UsageCount Value="58"/> | |||
| <TopLine Value="19"/> | |||
| <CursorPos X="3" Y="161"/> | |||
| <UsageCount Value="59"/> | |||
| </Unit4> | |||
| <Unit5> | |||
| <Filename Value="..\utils\uvkuPhysicalDevice.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="8"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="245"/> | |||
| <CursorPos X="38" Y="252"/> | |||
| <UsageCount Value="58"/> | |||
| <Loaded Value="True"/> | |||
| <UsageCount Value="59"/> | |||
| </Unit5> | |||
| <Unit6> | |||
| <Filename Value="..\utils\uvkuAllocationHandler.pas"/> | |||
| @@ -68,449 +67,407 @@ | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="91"/> | |||
| <CursorPos X="39" Y="99"/> | |||
| <UsageCount Value="48"/> | |||
| <UsageCount Value="49"/> | |||
| </Unit6> | |||
| <Unit7> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="2"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="51"/> | |||
| <CursorPos X="63" Y="66"/> | |||
| <UsageCount Value="52"/> | |||
| <Loaded Value="True"/> | |||
| <UsageCount Value="53"/> | |||
| </Unit7> | |||
| <Unit8> | |||
| <Filename Value="..\utils\uvkuDeviceFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="37"/> | |||
| <CursorPos X="49" Y="56"/> | |||
| <UsageCount Value="50"/> | |||
| <EditorIndex Value="4"/> | |||
| <TopLine Value="118"/> | |||
| <CursorPos X="39" Y="123"/> | |||
| <UsageCount Value="51"/> | |||
| <Loaded Value="True"/> | |||
| </Unit8> | |||
| <Unit9> | |||
| <Filename Value="..\utils\uvkuPhysicalDeviceFactory.pas"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="5"/> | |||
| <CursorPos X="19" Y="17"/> | |||
| <UsageCount Value="49"/> | |||
| </Unit9> | |||
| <Unit10> | |||
| <Filename Value="..\utils\uvkuSurface.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="3"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="41"/> | |||
| <CursorPos X="94" Y="56"/> | |||
| <UsageCount Value="46"/> | |||
| </Unit9> | |||
| <Unit10> | |||
| <Filename Value="..\utils\uvkuSurfaceFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="34"/> | |||
| <CursorPos X="43" Y="47"/> | |||
| <UsageCount Value="45"/> | |||
| <Loaded Value="True"/> | |||
| </Unit10> | |||
| <Unit11> | |||
| <Filename Value="..\utils\uvkuSurfaceFactory.pas"/> | |||
| <Filename Value="..\utils\uvkuSwapChainFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="30"/> | |||
| <CursorPos X="42" Y="43"/> | |||
| <UsageCount Value="44"/> | |||
| <TopLine Value="51"/> | |||
| <CursorPos X="14" Y="64"/> | |||
| <UsageCount Value="36"/> | |||
| </Unit11> | |||
| <Unit12> | |||
| <Filename Value="..\utils\uvkuSwapChainFactory.pas"/> | |||
| <Filename Value="..\utils\uvkuSwapChain.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="141"/> | |||
| <CursorPos X="11" Y="156"/> | |||
| <TopLine Value="62"/> | |||
| <CursorPos X="35" Y="78"/> | |||
| <UsageCount Value="35"/> | |||
| </Unit12> | |||
| <Unit13> | |||
| <Filename Value="..\utils\uvkuSwapChain.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="4"/> | |||
| <TopLine Value="62"/> | |||
| <CursorPos X="35" Y="78"/> | |||
| <UsageCount Value="34"/> | |||
| <Loaded Value="True"/> | |||
| </Unit13> | |||
| <Unit14> | |||
| <Filename Value="..\utils\uvkuImageView.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="5"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="29"/> | |||
| <CursorPos X="64" Y="47"/> | |||
| <UsageCount Value="31"/> | |||
| <Loaded Value="True"/> | |||
| <UsageCount Value="32"/> | |||
| </Unit13> | |||
| <Unit14> | |||
| <Filename Value="..\utils\uvkuImageViewFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="60"/> | |||
| <CursorPos X="55" Y="79"/> | |||
| <UsageCount Value="32"/> | |||
| </Unit14> | |||
| <Unit15> | |||
| <Filename Value="..\utils\uvkuImageViewFactory.pas"/> | |||
| <Filename Value="..\utils\uvkuImage.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="34"/> | |||
| <CursorPos X="52" Y="45"/> | |||
| <TopLine Value="36"/> | |||
| <CursorPos X="102" Y="51"/> | |||
| <UsageCount Value="31"/> | |||
| </Unit15> | |||
| <Unit16> | |||
| <Filename Value="..\utils\uvkuImage.pas"/> | |||
| <Filename Value="..\utils\uvkuBase.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="36"/> | |||
| <CursorPos X="102" Y="51"/> | |||
| <TopLine Value="26"/> | |||
| <CursorPos X="5" Y="39"/> | |||
| <UsageCount Value="30"/> | |||
| </Unit16> | |||
| <Unit17> | |||
| <Filename Value="..\utils\uvkuDeviceMemory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="33"/> | |||
| <CursorPos X="79" Y="44"/> | |||
| <UsageCount Value="28"/> | |||
| </Unit17> | |||
| <Unit18> | |||
| <Filename Value="..\utils\uvkuBuffer.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="10"/> | |||
| <CursorPos X="3" Y="13"/> | |||
| <UsageCount Value="27"/> | |||
| </Unit18> | |||
| <Unit19> | |||
| <Filename Value="..\utils\uvkuImageFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="113"/> | |||
| <CursorPos X="51" Y="132"/> | |||
| <UsageCount Value="27"/> | |||
| </Unit19> | |||
| <Unit20> | |||
| <Filename Value="..\utils\uvkuTypes.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="3"/> | |||
| <TopLine Value="13"/> | |||
| <CursorPos X="28" Y="26"/> | |||
| <UsageCount Value="27"/> | |||
| <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="26"/> | |||
| </Unit21> | |||
| <Unit22> | |||
| <Filename Value="..\utils\uvkuBufferView.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="52"/> | |||
| <CursorPos X="56" Y="76"/> | |||
| <UsageCount Value="26"/> | |||
| </Unit22> | |||
| <Unit23> | |||
| <Filename Value="..\utils\uvkuBufferViewFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="59"/> | |||
| <CursorPos X="56" Y="78"/> | |||
| <UsageCount Value="25"/> | |||
| </Unit23> | |||
| <Unit24> | |||
| <Filename Value="..\utils\uvkuCommandPool.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="57"/> | |||
| <CursorPos X="62" Y="68"/> | |||
| <UsageCount Value="25"/> | |||
| </Unit24> | |||
| <Unit25> | |||
| <Filename Value="..\utils\uvkuCommandPoolFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="45"/> | |||
| <CursorPos X="57" Y="64"/> | |||
| <UsageCount Value="24"/> | |||
| </Unit25> | |||
| <Unit26> | |||
| <Filename Value="..\utils\uvkuCommandBuffer.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <CursorPos X="39" Y="13"/> | |||
| <UsageCount Value="24"/> | |||
| </Unit26> | |||
| <Unit27> | |||
| <Filename Value="..\utils\uvkuQueue.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="7"/> | |||
| <CursorPos X="22" Y="23"/> | |||
| <UsageCount Value="24"/> | |||
| </Unit27> | |||
| <Unit28> | |||
| <Filename Value="..\utils\VulkanUtils.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <CursorPos X="29" Y="10"/> | |||
| <UsageCount Value="23"/> | |||
| </Unit28> | |||
| <Unit29> | |||
| <Filename Value="..\utils\uvkuPhysicalDeviceFactory.pas"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="5"/> | |||
| <CursorPos X="19" Y="17"/> | |||
| <UsageCount Value="49"/> | |||
| </Unit29> | |||
| <Unit30> | |||
| <Filename Value="..\utils\uvkuUtils.pas"/> | |||
| <EditorIndex Value="7"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="41"/> | |||
| <CursorPos X="45" Y="61"/> | |||
| <UsageCount Value="42"/> | |||
| <Loaded Value="True"/> | |||
| </Unit17> | |||
| <Unit18> | |||
| </Unit30> | |||
| <Unit31> | |||
| <Filename Value="..\..\data\Vulkan.tpl"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="44"/> | |||
| <CursorPos X="27" Y="22"/> | |||
| <UsageCount Value="13"/> | |||
| <DefaultSyntaxHighlighter Value="None"/> | |||
| </Unit18> | |||
| <Unit19> | |||
| </Unit31> | |||
| <Unit32> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\packages\fcl-base\src\custapp.pp"/> | |||
| <UnitName Value="CustApp"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="13"/> | |||
| <CursorPos X="3" Y="30"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit19> | |||
| <Unit20> | |||
| </Unit32> | |||
| <Unit33> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\inc\objpash.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="213"/> | |||
| <CursorPos X="21" Y="224"/> | |||
| <UsageCount Value="8"/> | |||
| </Unit20> | |||
| <Unit21> | |||
| <TopLine Value="181"/> | |||
| <CursorPos X="21" Y="223"/> | |||
| <UsageCount Value="10"/> | |||
| </Unit33> | |||
| <Unit34> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\lcl\include\customform.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="138"/> | |||
| <CursorPos Y="154"/> | |||
| <UsageCount Value="8"/> | |||
| </Unit21> | |||
| <Unit22> | |||
| </Unit34> | |||
| <Unit35> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\objpas\sysutils\sysstrh.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="96"/> | |||
| <CursorPos X="10" Y="112"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit22> | |||
| <Unit23> | |||
| </Unit35> | |||
| <Unit36> | |||
| <Filename Value="..\Vulkan_old.pas"/> | |||
| <EditorIndex Value="-1"/> | |||
| <WindowIndex Value="-1"/> | |||
| <TopLine Value="2195"/> | |||
| <CursorPos X="3" Y="2211"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit23> | |||
| <Unit24> | |||
| </Unit36> | |||
| <Unit37> | |||
| <Filename Value="..\Vulkan.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <CursorPos X="9" Y="5"/> | |||
| <UsageCount Value="10"/> | |||
| </Unit24> | |||
| <Unit25> | |||
| </Unit37> | |||
| <Unit38> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\lcl\forms.pp"/> | |||
| <UnitName Value="Forms"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="1249"/> | |||
| <CursorPos X="3" Y="1268"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit25> | |||
| <Unit26> | |||
| </Unit38> | |||
| <Unit39> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\objpas\classes\classesh.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="2100"/> | |||
| <CursorPos X="38" Y="2125"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit26> | |||
| <Unit27> | |||
| </Unit39> | |||
| <Unit40> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\lcl\extctrls.pp"/> | |||
| <UnitName Value="ExtCtrls"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="1023"/> | |||
| <CursorPos X="3" Y="1038"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit27> | |||
| <Unit28> | |||
| </Unit40> | |||
| <Unit41> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\lcl\controls.pp"/> | |||
| <UnitName Value="Controls"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="2240"/> | |||
| <CursorPos X="3" Y="2255"/> | |||
| <UsageCount Value="9"/> | |||
| </Unit28> | |||
| <Unit29> | |||
| </Unit41> | |||
| <Unit42> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\objpas\sysutils\sysutilh.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="22"/> | |||
| <CursorPos X="4" Y="37"/> | |||
| <UsageCount Value="11"/> | |||
| </Unit29> | |||
| <Unit30> | |||
| </Unit42> | |||
| <Unit43> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\win\sysosh.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="7"/> | |||
| <CursorPos X="3" Y="22"/> | |||
| <UsageCount Value="11"/> | |||
| </Unit30> | |||
| <Unit31> | |||
| </Unit43> | |||
| <Unit44> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\inc\systemh.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="93"/> | |||
| <CursorPos X="19" Y="108"/> | |||
| <UsageCount Value="11"/> | |||
| </Unit31> | |||
| <Unit32> | |||
| </Unit44> | |||
| <Unit45> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\win\wininc\ascdef.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="57"/> | |||
| <CursorPos X="10" Y="72"/> | |||
| <UsageCount Value="11"/> | |||
| </Unit32> | |||
| <Unit33> | |||
| </Unit45> | |||
| <Unit46> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\win32\windows.pp"/> | |||
| <EditorIndex Value="-1"/> | |||
| <UsageCount Value="11"/> | |||
| </Unit33> | |||
| <Unit34> | |||
| </Unit46> | |||
| <Unit47> | |||
| <Filename Value="C:\Zusatzprogramme\Lazarus\fpc\3.1.1\source\rtl\win\wininc\base.inc"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="84"/> | |||
| <CursorPos X="6" Y="99"/> | |||
| <UsageCount Value="11"/> | |||
| </Unit34> | |||
| <Unit35> | |||
| <Filename Value="..\utils\uvkuBase.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="60"/> | |||
| <CursorPos X="41" Y="65"/> | |||
| <UsageCount Value="29"/> | |||
| </Unit35> | |||
| <Unit36> | |||
| <Filename Value="..\utils\uvkuDeviceMemory.pas"/> | |||
| </Unit47> | |||
| <Unit48> | |||
| <Filename Value="..\utils\uvkuRenderPass.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <IsVisibleTab Value="True"/> | |||
| <EditorIndex Value="6"/> | |||
| <TopLine Value="33"/> | |||
| <CursorPos X="79" Y="44"/> | |||
| <UsageCount Value="27"/> | |||
| <EditorIndex Value="1"/> | |||
| <TopLine Value="12"/> | |||
| <CursorPos X="58" Y="31"/> | |||
| <UsageCount Value="21"/> | |||
| <Loaded Value="True"/> | |||
| </Unit36> | |||
| <Unit37> | |||
| <Filename Value="..\utils\uvkuBuffer.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="10"/> | |||
| <CursorPos X="3" Y="13"/> | |||
| <UsageCount Value="26"/> | |||
| </Unit37> | |||
| <Unit38> | |||
| <Filename Value="..\utils\uvkuImageFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="36"/> | |||
| <CursorPos X="3" Y="22"/> | |||
| <UsageCount Value="26"/> | |||
| </Unit38> | |||
| <Unit39> | |||
| <Filename Value="..\utils\uvkuTypes.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="13"/> | |||
| <CursorPos X="57" Y="39"/> | |||
| <UsageCount Value="26"/> | |||
| </Unit39> | |||
| <Unit40> | |||
| <Filename Value="..\utils\uvkuBufferFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="27"/> | |||
| <CursorPos X="49" Y="48"/> | |||
| <UsageCount Value="25"/> | |||
| </Unit40> | |||
| <Unit41> | |||
| <Filename Value="..\utils\uvkuBufferView.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="52"/> | |||
| <CursorPos X="56" Y="76"/> | |||
| <UsageCount Value="25"/> | |||
| </Unit41> | |||
| <Unit42> | |||
| <Filename Value="..\utils\uvkuBufferViewFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="59"/> | |||
| <CursorPos X="120" Y="68"/> | |||
| <UsageCount Value="24"/> | |||
| </Unit42> | |||
| <Unit43> | |||
| <Filename Value="..\utils\uvkuCommandPool.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="57"/> | |||
| <CursorPos X="62" Y="68"/> | |||
| <UsageCount Value="24"/> | |||
| </Unit43> | |||
| <Unit44> | |||
| <Filename Value="..\utils\uvkuCommandPoolFactory.pas"/> | |||
| </Unit48> | |||
| <Unit49> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <TopLine Value="49"/> | |||
| <CursorPos X="95" Y="58"/> | |||
| <UsageCount Value="23"/> | |||
| </Unit44> | |||
| <Unit45> | |||
| <Filename Value="..\utils\uvkuCommandBuffer.pas"/> | |||
| <TopLine Value="170"/> | |||
| <CursorPos X="70" Y="188"/> | |||
| <UsageCount Value="21"/> | |||
| <Loaded Value="True"/> | |||
| </Unit49> | |||
| <Unit50> | |||
| <Filename Value="..\utils\uvkuFactoryBase.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="-1"/> | |||
| <CursorPos X="39" Y="13"/> | |||
| <UsageCount Value="23"/> | |||
| </Unit45> | |||
| <Unit46> | |||
| <Filename Value="..\utils\uvkuQueue.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="10"/> | |||
| <TopLine Value="7"/> | |||
| <CursorPos X="22" Y="23"/> | |||
| <UsageCount Value="23"/> | |||
| <Loaded Value="True"/> | |||
| </Unit46> | |||
| <Unit47> | |||
| <Filename Value="..\utils\VulkanUtils.pas"/> | |||
| <IsPartOfProject Value="True"/> | |||
| <EditorIndex Value="1"/> | |||
| <TopLine Value="31"/> | |||
| <CursorPos X="3" Y="46"/> | |||
| <UsageCount Value="22"/> | |||
| <Loaded Value="True"/> | |||
| </Unit47> | |||
| <UsageCount Value="21"/> | |||
| </Unit50> | |||
| </Units> | |||
| <JumpHistory Count="30" HistoryIndex="29"> | |||
| <JumpHistory Count="15" HistoryIndex="14"> | |||
| <Position1> | |||
| <Filename Value="uMainForm.pas"/> | |||
| <Caret Line="29" Column="5" TopLine="13"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="40" TopLine="13"/> | |||
| </Position1> | |||
| <Position2> | |||
| <Filename Value="..\utils\VulkanUtils.pas"/> | |||
| <Caret Line="46" Column="3" TopLine="31"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="26" Column="37"/> | |||
| </Position2> | |||
| <Position3> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="26" Column="32" TopLine="13"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="32" TopLine="18"/> | |||
| </Position3> | |||
| <Position4> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="65" Column="85" TopLine="62"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="57" Column="3" TopLine="28"/> | |||
| </Position4> | |||
| <Position5> | |||
| <Filename Value="..\Vulkan.pas"/> | |||
| <Caret Line="4593" Column="72" TopLine="4578"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="62" Column="20" TopLine="43"/> | |||
| </Position5> | |||
| <Position6> | |||
| <Filename Value="..\Vulkan.pas"/> | |||
| <Filename Value="..\utils\uvkuDeviceFactory.pas"/> | |||
| <Caret Line="58" Column="43" TopLine="46"/> | |||
| </Position6> | |||
| <Position7> | |||
| <Filename Value="..\Vulkan.pas"/> | |||
| <Caret Line="3400" Column="20" TopLine="3375"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="62" Column="20" TopLine="43"/> | |||
| </Position7> | |||
| <Position8> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="66" Column="37" TopLine="62"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="35" TopLine="21"/> | |||
| </Position8> | |||
| <Position9> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="63" Column="79" TopLine="48"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="98" Column="49" TopLine="77"/> | |||
| </Position9> | |||
| <Position10> | |||
| <Filename Value="uMainForm.pas"/> | |||
| <Caret Line="135" Column="51" TopLine="116"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="33" Column="49" TopLine="27"/> | |||
| </Position10> | |||
| <Position11> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="66" Column="75" TopLine="44"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="55" Column="109" TopLine="44"/> | |||
| </Position11> | |||
| <Position12> | |||
| <Filename Value="..\utils\uvkuUtils.pas"/> | |||
| <Caret Line="32" Column="88" TopLine="7"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="186" TopLine="150"/> | |||
| </Position12> | |||
| <Position13> | |||
| <Filename Value="..\utils\uvkuPhysicalDevice.pas"/> | |||
| <Caret Line="77" Column="59" TopLine="63"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="9" Column="67"/> | |||
| </Position13> | |||
| <Position14> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="53" Column="113" TopLine="44"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="190" Column="53" TopLine="170"/> | |||
| </Position14> | |||
| <Position15> | |||
| <Filename Value="..\utils\uvkuSurface.pas"/> | |||
| <Caret Line="54" TopLine="48"/> | |||
| <Filename Value="..\utils\uvkuRenderPassFactory.pas"/> | |||
| <Caret Line="188" Column="70" TopLine="170"/> | |||
| </Position15> | |||
| <Position16> | |||
| <Filename Value="..\utils\uvkuSwapChain.pas"/> | |||
| <Caret Line="9" Column="30"/> | |||
| </Position16> | |||
| <Position17> | |||
| <Filename Value="..\utils\uvkuImageView.pas"/> | |||
| <Caret Line="78" Column="73" TopLine="54"/> | |||
| </Position17> | |||
| <Position18> | |||
| <Filename Value="..\utils\uvkuDeviceMemory.pas"/> | |||
| <Caret TopLine="10"/> | |||
| </Position18> | |||
| <Position19> | |||
| <Filename Value="..\utils\uvkuDeviceMemory.pas"/> | |||
| <Caret Line="48" Column="78" TopLine="35"/> | |||
| </Position19> | |||
| <Position20> | |||
| <Filename Value="..\utils\uvkuSurface.pas"/> | |||
| <Caret Line="56" Column="52" TopLine="48"/> | |||
| </Position20> | |||
| <Position21> | |||
| <Filename Value="..\utils\uvkuSwapChain.pas"/> | |||
| <Caret Line="79" Column="52" TopLine="86"/> | |||
| </Position21> | |||
| <Position22> | |||
| <Filename Value="..\utils\uvkuImageView.pas"/> | |||
| <Caret Line="47" Column="52" TopLine="32"/> | |||
| </Position22> | |||
| <Position23> | |||
| <Filename Value="..\utils\uvkuPhysicalDevice.pas"/> | |||
| <Caret Line="266" Column="24" TopLine="245"/> | |||
| </Position23> | |||
| <Position24> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="66" Column="38" TopLine="75"/> | |||
| </Position24> | |||
| <Position25> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="53" Column="62" TopLine="38"/> | |||
| </Position25> | |||
| <Position26> | |||
| <Filename Value="..\utils\uvkuDevice.pas"/> | |||
| <Caret Line="66" Column="11" TopLine="72"/> | |||
| </Position26> | |||
| <Position27> | |||
| <Filename Value="..\utils\uvkuSurface.pas"/> | |||
| <Caret Line="56" Column="54" TopLine="41"/> | |||
| </Position27> | |||
| <Position28> | |||
| <Filename Value="..\utils\uvkuSwapChain.pas"/> | |||
| <Caret Line="79" Column="45" TopLine="76"/> | |||
| </Position28> | |||
| <Position29> | |||
| <Filename Value="..\utils\uvkuImageView.pas"/> | |||
| <Caret Line="47" Column="38" TopLine="29"/> | |||
| </Position29> | |||
| <Position30> | |||
| <Filename Value="..\utils\uvkuDeviceMemory.pas"/> | |||
| <Caret Line="48" Column="38" TopLine="49"/> | |||
| </Position30> | |||
| </JumpHistory> | |||
| </ProjectSession> | |||
| <Debugging> | |||
| @@ -13,7 +13,8 @@ uses | |||
| uvkuSwapChain, uvkuSwapChainFactory, | |||
| uvkuImage, uvkuImageFactory, uvkuImageView, uvkuImageViewFactory, | |||
| uvkuBuffer, uvkuBufferFactory, uvkuBufferView, uvkuBufferViewFactory, | |||
| uvkuCommandPool, uvkuCommandPoolFactory, uvkuCommandBuffer; | |||
| uvkuCommandPool, uvkuCommandPoolFactory, uvkuCommandBuffer, | |||
| uvkuRenderPass, uvkuRenderPassFactory; | |||
| type | |||
| { Types } | |||
| @@ -81,6 +82,11 @@ type | |||
| TvkuCommandPoolFactory = uvkuCommandPoolFactory.TvkuCommandPoolFactory; | |||
| TvkuCommandBuffer = uvkuCommandBuffer.TvkuCommandBuffer; | |||
| { RenderPass } | |||
| TvkuRenderPass = uvkuRenderPass.TvkuRenderPass; | |||
| TvkuRenderPassEx = uvkuRenderPassFactory.TvkuRenderPassEx; | |||
| TvkuRenderPassFactory = uvkuRenderPassFactory.TvkuRenderPassFactory; | |||
| implementation | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuBuffer, uvkuDevice, uvkuAllocationHandler, uvkuTypes; | |||
| Vulkan, uvkuBuffer, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,9 +19,8 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuBufferFactory = class(TObject) | |||
| TvkuBufferFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| fFlags: VkBufferCreateFlags; | |||
| fSize: VkDeviceSize; | |||
| fUsage: VkBufferUsageFlags; | |||
| @@ -32,7 +31,6 @@ type | |||
| function GetQueueFamilyIndexCount: Integer; | |||
| procedure SetQueueFamilyIndex(const aIndex: Integer; aValue: VkUint32); | |||
| public | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| property Flags: VkBufferCreateFlags read fFlags write fFlags; | |||
| property Size: VkDeviceSize read fSize write fSize; | |||
| property Usage: VkBufferUsageFlags read fUsage write fUsage; | |||
| @@ -46,9 +44,6 @@ type | |||
| function CreateBuffer( | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuBufferEx; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| end; | |||
| implementation | |||
| @@ -61,9 +56,9 @@ uses | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| destructor TvkuBufferEx.Destroy; | |||
| begin | |||
| inherited Destroy; | |||
| if fOwnsHandle then | |||
| FreeAndNil(fAllocHandler); | |||
| inherited Destroy; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -112,8 +107,8 @@ begin | |||
| CreateInfo.pQueueFamilyIndices := @fQueueFamilyIndices[0]; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuBufferEx.Create(CreateInfo, fDeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuBufferEx.Create(CreateInfo, fDeviceCommands); | |||
| then result := TvkuBufferEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuBufferEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuBufferEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuBufferEx(result).fOwnsHandle := aOwnsHandler; | |||
| @@ -123,18 +118,5 @@ begin | |||
| end; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuBufferFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuBufferFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| end; | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuBufferView, uvkuAllocationHandler, uvkuDevice; | |||
| Vulkan, uvkuBufferView, uvkuAllocationHandler, uvkuDevice, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,18 +19,14 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuBufferViewFactory = class(TObject) | |||
| TvkuBufferViewFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| fFlags: VkBufferViewCreateFlags; | |||
| fBuffer: VkBuffer; | |||
| fFormat: TVkFormat; | |||
| fOffset: VkDeviceSize; | |||
| fRange: VkDeviceSize; | |||
| public | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| property Flags: VkBufferViewCreateFlags read fFlags write fFlags; | |||
| property Buffer: VkBuffer read fBuffer write fBuffer; | |||
| property Format: TVkFormat read fFormat write fFormat; | |||
| @@ -41,9 +37,6 @@ type | |||
| function CreateBufferView( | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuBufferViewEx; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| end; | |||
| implementation | |||
| @@ -54,6 +47,8 @@ implementation | |||
| destructor TvkuBufferViewEx.Destroy; | |||
| begin | |||
| inherited Destroy; | |||
| if fOwnsHandler then | |||
| FreeAndNil(fAllocHandler); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -79,8 +74,8 @@ begin | |||
| CreateInfo.range := fRange; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuBufferViewEx.Create(CreateInfo, fDeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuBufferViewEx.Create(CreateInfo, fDeviceCommands); | |||
| then result := TvkuBufferViewEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuBufferViewEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuBufferViewEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuBufferViewEx(result).fOwnsHandler := aOwnsHandler; | |||
| @@ -90,18 +85,5 @@ begin | |||
| end; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuBufferViewFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuBufferViewFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| end; | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuCommandPool, uvkuDevice, uvkuAllocationHandler; | |||
| Vulkan, uvkuCommandPool, uvkuDevice, uvkuAllocationHandler, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,9 +19,8 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuCommandPoolFactory = class(TObject) | |||
| TvkuCommandPoolFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| fFlags: VkCommandPoolCreateFlags; | |||
| fQueueFamilyIndex: VkUint32; | |||
| public | |||
| @@ -29,9 +28,6 @@ type | |||
| function CreateCommandPool( | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuCommandPoolEx; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| end; | |||
| implementation | |||
| @@ -41,9 +37,9 @@ implementation | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| destructor TvkuCommandPoolEx.Destroy; | |||
| begin | |||
| inherited Destroy; | |||
| if fOwnsHandler then | |||
| FreeAndNil(fAllocHandler); | |||
| inherited Destroy; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -64,8 +60,8 @@ begin | |||
| CreateInfo.flags := fFlags; | |||
| CreateInfo.queueFamilyIndex := fQueueFamilyIndex; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuCommandPoolEx.Create(CreateInfo, fDeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuCommandPoolEx.Create(CreateInfo, fDeviceCommands); | |||
| then result := TvkuCommandPoolEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuCommandPoolEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuCommandPoolEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuCommandPoolEx(result).fOwnsHandler := aOwnsHandler; | |||
| @@ -75,18 +71,5 @@ begin | |||
| end; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuCommandPoolFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuCommandPoolFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| end; | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuInstance, uvkuDevice, uvkuAllocationHandler, uvkuTypes; | |||
| Vulkan, uvkuInstance, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,9 +19,8 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuDeviceFactory = class(TObject) | |||
| TvkuDeviceFactory = class(TvkuInstanceObjFactory) | |||
| private | |||
| fInstanceCommands: TVkInstanceCommands; | |||
| fFeatures: TVkPhysicalDeviceFeatures; | |||
| fFlags: VkDeviceCreateFlags; | |||
| fLayers: TStringList; | |||
| @@ -55,9 +54,8 @@ type | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuDeviceEx; | |||
| constructor Create(const aInstance: TvkuInstance); | |||
| constructor Create(const aInstanceCommands: TVkInstanceCommands); | |||
| destructor Destroy; override; | |||
| procedure AfterConstruction; override; | |||
| procedure BeforeDestruction; override; | |||
| end; | |||
| implementation | |||
| @@ -184,8 +182,8 @@ begin | |||
| CreateInfo.pEnabledFeatures := @fFeatures; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuDeviceEx.Create(aPhysicalDevice, CreateInfo, fInstanceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuDeviceEx.Create(aPhysicalDevice, CreateInfo, fInstanceCommands); | |||
| then result := TvkuDeviceEx.Create(aPhysicalDevice, CreateInfo, InstanceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuDeviceEx.Create(aPhysicalDevice, CreateInfo, InstanceCommands); | |||
| try | |||
| TvkuDeviceEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuDeviceEx(result).fOwnsHandler := aOwnsHandler; | |||
| @@ -196,27 +194,20 @@ begin | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuDeviceFactory.Create(const aInstance: TvkuInstance); | |||
| begin | |||
| Create(aInstance.InstanceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuDeviceFactory.Create(const aInstanceCommands: TVkInstanceCommands); | |||
| procedure TvkuDeviceFactory.AfterConstruction; | |||
| begin | |||
| inherited Create; | |||
| inherited AfterConstruction; | |||
| FillByte(fFeatures, SizeOf(fFeatures), 0); | |||
| fInstanceCommands := aInstanceCommands; | |||
| fLayers := TStringList.Create; | |||
| fExtensions := TStringList.Create; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| destructor TvkuDeviceFactory.Destroy; | |||
| procedure TvkuDeviceFactory.BeforeDestruction; | |||
| begin | |||
| FreeAndNil(fLayers); | |||
| FreeAndNil(fExtensions); | |||
| inherited Destroy; | |||
| inherited BeforeDestruction; | |||
| end; | |||
| end. | |||
| @@ -0,0 +1,71 @@ | |||
| unit uvkuFactoryBase; | |||
| {$mode objfpc}{$H+} | |||
| interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuInstance, uvkuDevice; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuFactory = class(TObject) | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuInstanceObjFactory = class(TvkuFactory) | |||
| private | |||
| fInstanceCommands: TVkInstanceCommands; | |||
| public | |||
| property InstanceCommands: TVkInstanceCommands read fInstanceCommands; | |||
| constructor Create(const aInstance: TvkuInstance); | |||
| constructor Create(const aInstanceCommands: TVkInstanceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuDeviceObjFactory = class(TvkuFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| public | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| end; | |||
| implementation | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| //TvkuInstanceObjFactory///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuInstanceObjFactory.Create(const aInstance: TvkuInstance); | |||
| begin | |||
| Create(aInstance.InstanceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuInstanceObjFactory.Create(const aInstanceCommands: TVkInstanceCommands); | |||
| begin | |||
| inherited Create; | |||
| fInstanceCommands := aInstanceCommands; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| //TvkuDeviceObjFactory/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuDeviceObjFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuDeviceObjFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| end; | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuImage, uvkuDevice, uvkuAllocationHandler, uvkuTypes; | |||
| Vulkan, uvkuImage, uvkuDevice, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,9 +19,8 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuImageFactory = class(TObject) | |||
| TvkuImageFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| fFlags: VkImageCreateFlags; | |||
| fImageType: TVkImageType; | |||
| fFormat: TVkFormat; | |||
| @@ -39,7 +38,6 @@ type | |||
| function GetQueueFamilyIndexCount: Integer; | |||
| procedure SetQueueFamilyIndex(const aIndex: Integer; aValue: VkUint32); | |||
| public | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| property Flags: VkImageCreateFlags read fFlags write fFlags; | |||
| property ImageType: TVkImageType read fImageType write fImageType; | |||
| property Format: TVkFormat read fFormat write fFormat; | |||
| @@ -60,9 +58,6 @@ type | |||
| function CreateImage( | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuImageEx; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| end; | |||
| implementation | |||
| @@ -75,9 +70,9 @@ uses | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| destructor TvkuImageEx.Destroy; | |||
| begin | |||
| inherited Destroy; | |||
| if fOwnsHandle then | |||
| FreeAndNil(fAllocHandler); | |||
| inherited Destroy; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -133,8 +128,8 @@ begin | |||
| CreateInfo.initialLayout := fInitialLayout; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuImageEx.Create(CreateInfo, fDeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuImageEx.Create(CreateInfo, fDeviceCommands); | |||
| then result := TvkuImageEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuImageEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuImageEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuImageEx(result).fOwnsHandle := aOwnsHandler; | |||
| @@ -144,18 +139,5 @@ begin | |||
| end; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuImageFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuImageFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| end; | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuAllocationHandler, uvkuImageView, uvkuDevice; | |||
| Vulkan, uvkuAllocationHandler, uvkuImageView, uvkuDevice, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,10 +19,8 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuImageViewFactory = class(TObject) | |||
| TvkuImageViewFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| fFlags: VkImageViewCreateFlags; | |||
| fImage: VkImage; | |||
| fViewType: TVkImageViewType; | |||
| @@ -30,8 +28,6 @@ type | |||
| fComponents: TVkComponentMapping; | |||
| fSubresourceRange: TVkImageSubresourceRange; | |||
| public | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| property Flags: VkImageViewCreateFlags read fFlags write fFlags; | |||
| property Image: VkImage read fImage write fImage; | |||
| property ViewType: TVkImageViewType read fViewType write fViewType; | |||
| @@ -43,9 +39,6 @@ type | |||
| function CreateImageView( | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuImageViewEx; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| end; | |||
| implementation | |||
| @@ -82,8 +75,8 @@ begin | |||
| CreateInfo.components := fComponents; | |||
| CreateInfo.subresourceRange := fSubresourceRange; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuImageViewEx.Create(CreateInfo, fDeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuImageViewEx.Create(CreateInfo, fDeviceCommands); | |||
| then result := TvkuImageViewEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuImageViewEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuImageViewEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuImageViewEx(result).fOwnsHandler := aOwnsHandler; | |||
| @@ -93,18 +86,5 @@ begin | |||
| end; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuImageViewFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuImageViewFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| end; | |||
| end. | |||
| @@ -7,7 +7,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuInstance, uvkuAllocationHandler, uvkuTypes; | |||
| Vulkan, uvkuInstance, uvkuAllocationHandler, uvkuTypes, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -20,7 +20,7 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuInstanceFactory = class(TObject) | |||
| TvkuInstanceFactory = class(TvkuFactory) | |||
| private | |||
| fFlags: VkInstanceCreateFlags; | |||
| fApplicationInfo: TvkuApplicationInfo; | |||
| @@ -0,0 +1,84 @@ | |||
| unit uvkuRenderPass; | |||
| {$mode objfpc}{$H+} | |||
| interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuRenderPass = class(TvkuAllocHandle) | |||
| private | |||
| fHandle: VkRenderPass; | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| procedure CreateHandle(const aCreateInfo: TVkRenderPassCreateInfo); | |||
| public | |||
| property Handle: VkRenderPass read fHandle; | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| constructor Create( | |||
| const aCreateInfo: TVkRenderPassCreateInfo; | |||
| const aDeviceCommands: TVkDeviceCommands; | |||
| const aAllocCallbacks: PVkAllocationCallbacks = nil); | |||
| constructor Create( | |||
| const aHandle: VkRenderPass; | |||
| const aOwnsHandle: Boolean; | |||
| const aDeviceCommands: TVkDeviceCommands; | |||
| const aAllocCallbacks: PVkAllocationCallbacks = nil); | |||
| destructor Destroy; override; | |||
| end; | |||
| implementation | |||
| uses | |||
| uvkuUtils; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| //TvkuRenderPass///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPass.CreateHandle(const aCreateInfo: TVkRenderPassCreateInfo); | |||
| var err: TVkResult; | |||
| begin | |||
| if not Assigned(fDeviceCommands.vkCreateRenderPass) then | |||
| raise TvkuInvalidFuncPtrException.Create('vkCreateRenderPass'); | |||
| err := fDeviceCommands.vkCreateRenderPass(fDeviceCommands.Device, @aCreateInfo, AllocCallbacks, @fHandle); | |||
| if (err < VK_SUCCESS) then | |||
| raise TvkuErrorException.Create('unable to create render pass', err); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuRenderPass.Create(const aCreateInfo: TVkRenderPassCreateInfo; const aDeviceCommands: TVkDeviceCommands; | |||
| const aAllocCallbacks: PVkAllocationCallbacks); | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| SetAllocCallbacks(aAllocCallbacks); | |||
| CreateHandle(aCreateInfo); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuRenderPass.Create(const aHandle: VkRenderPass; const aOwnsHandle: Boolean; | |||
| const aDeviceCommands: TVkDeviceCommands; const aAllocCallbacks: PVkAllocationCallbacks); | |||
| begin | |||
| inherited Create; | |||
| fHandle := aHandle; | |||
| fDeviceCommands := aDeviceCommands; | |||
| OwnsHandle := aOwnsHandle; | |||
| SetAllocCallbacks(aAllocCallbacks); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| destructor TvkuRenderPass.Destroy; | |||
| begin | |||
| if OwnsHandle and (fHandle <> VK_INVALID_NDP_HANDLE) then | |||
| fDeviceCommands.vkDestroyRenderPass(fDeviceCommands.Device, fHandle, AllocCallbacks); | |||
| fHandle := VK_INVALID_NDP_HANDLE; | |||
| inherited Destroy; | |||
| end; | |||
| end. | |||
| @@ -0,0 +1,200 @@ | |||
| unit uvkuRenderPassFactory; | |||
| {$mode objfpc}{$H+} | |||
| interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuFactoryBase, uvkuRenderPass, uvkuAllocationHandler, uvkuTypes; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuRenderPassEx = class(TvkuRenderPass) | |||
| private | |||
| fAllocHandler: TvkuAllocationHandler; | |||
| fOwnsHandler: Boolean; | |||
| public | |||
| destructor Destroy; override; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuRenderPassFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fFlags: VkRenderPassCreateFlags; | |||
| fAttachments: TvkuAttachmentDescriptionArr; | |||
| fSubpasses: TvkuSubpassDescriptionArr; | |||
| fDependencies: TvkuSubpassDependencyArr; | |||
| function GetAttachment(const aIndex: Integer): TVkAttachmentDescription; | |||
| function GetAttachmentCount: Integer; | |||
| function GetDependency(const aIndex: Integer): TVkSubpassDependency; | |||
| function GetDependencyCount: Integer; | |||
| function GetSubpass(const aIndex: Integer): TVkSubpassDescription; | |||
| function GetSubpassCount: Integer; | |||
| procedure SetAttachment(const aIndex: Integer; aValue: TVkAttachmentDescription); | |||
| procedure SetAttachmentCount(aValue: Integer); | |||
| procedure SetDependency(const aIndex: Integer; aValue: TVkSubpassDependency); | |||
| procedure SetDependencyCount(aValue: Integer); | |||
| procedure SetSubpass(const aIndex: Integer; aValue: TVkSubpassDescription); | |||
| procedure SetSubpassCount(aValue: Integer); | |||
| public | |||
| property Flags: VkRenderPassCreateFlags read fFlags write fFlags; | |||
| property Attachments: TvkuAttachmentDescriptionArr read fAttachments write fAttachments; | |||
| property AttachmentCount: Integer read GetAttachmentCount write SetAttachmentCount; | |||
| property Attachment[const aIndex: Integer]: TVkAttachmentDescription read GetAttachment write SetAttachment; | |||
| property Subpasses: TvkuSubpassDescriptionArr read fSubpasses write fSubpasses; | |||
| property SubpassCount: Integer read GetSubpassCount write SetSubpassCount; | |||
| property Subpass[const aIndex: Integer]: TVkSubpassDescription read GetSubpass write SetSubpass; | |||
| property Dependencies: TvkuSubpassDependencyArr read fDependencies write fDependencies; | |||
| property DependencyCount: Integer read GetDependencyCount write SetDependencyCount; | |||
| property Dependency[const aIndex: Integer]: TVkSubpassDependency read GetDependency write SetDependency; | |||
| function CreateRenderPass: TvkuRenderPassEx; | |||
| function CreateRenderPass( | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuRenderPassEx; | |||
| end; | |||
| implementation | |||
| uses | |||
| uvkuUtils; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| //TvkuRenderPassEx/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| destructor TvkuRenderPassEx.Destroy; | |||
| begin | |||
| inherited Destroy; | |||
| if fOwnsHandler then | |||
| FreeAndNil(fAllocHandler); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| //TvkuRenderPassFactory////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.GetAttachment(const aIndex: Integer): TVkAttachmentDescription; | |||
| begin | |||
| if (aIndex < low(fAttachments)) or (aIndex > high(fAttachments)) then | |||
| raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fAttachments), High(fAttachments)]); | |||
| result := fAttachments[aIndex]; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.GetAttachmentCount: Integer; | |||
| begin | |||
| result := Length(fAttachments); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.GetDependency(const aIndex: Integer): TVkSubpassDependency; | |||
| begin | |||
| if (aIndex < low(fDependencies)) or (aIndex > high(fDependencies)) then | |||
| raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fDependencies), High(fDependencies)]); | |||
| result := fDependencies[aIndex]; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.GetDependencyCount: Integer; | |||
| begin | |||
| result := Length(fDependencies); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.GetSubpass(const aIndex: Integer): TVkSubpassDescription; | |||
| begin | |||
| if (aIndex < low(fSubpasses)) or (aIndex > high(fSubpasses)) then | |||
| raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fSubpasses), High(fSubpasses)]); | |||
| result := fSubpasses[aIndex]; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.GetSubpassCount: Integer; | |||
| begin | |||
| result := Length(fSubpasses); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPassFactory.SetAttachment(const aIndex: Integer; aValue: TVkAttachmentDescription); | |||
| begin | |||
| if (aIndex < low(fAttachments)) or (aIndex > high(fAttachments)) then | |||
| raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fAttachments), High(fAttachments)]); | |||
| fAttachments[aIndex] := aValue; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPassFactory.SetAttachmentCount(aValue: Integer); | |||
| begin | |||
| SetLength(fAttachments, aValue); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPassFactory.SetDependency(const aIndex: Integer; aValue: TVkSubpassDependency); | |||
| begin | |||
| if (aIndex < low(fDependencies)) or (aIndex > high(fDependencies)) then | |||
| raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fDependencies), High(fDependencies)]); | |||
| fDependencies[aIndex] := aValue; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPassFactory.SetDependencyCount(aValue: Integer); | |||
| begin | |||
| SetLength(fDependencies, aValue); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPassFactory.SetSubpass(const aIndex: Integer; aValue: TVkSubpassDescription); | |||
| begin | |||
| if (aIndex < low(fSubpasses)) or (aIndex > high(fSubpasses)) then | |||
| raise TvkuException.CreateFmt('index (%d) out of range (%d : %d)', [aIndex, Low(fSubpasses), High(fSubpasses)]); | |||
| fSubpasses[aIndex] := aValue; | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| procedure TvkuRenderPassFactory.SetSubpassCount(aValue: Integer); | |||
| begin | |||
| SetLength(fSubpasses, aValue); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.CreateRenderPass: TvkuRenderPassEx; | |||
| begin | |||
| result := CreateRenderPass(nil, false); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| function TvkuRenderPassFactory.CreateRenderPass(const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuRenderPassEx; | |||
| var | |||
| CreateInfo: TVkRenderPassCreateInfo; | |||
| begin | |||
| FillByte(CreateInfo, SizeOf(CreateInfo), 0); | |||
| CreateInfo.sType := VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; | |||
| CreateInfo.pNext := nil; | |||
| CreateInfo.flags := fFlags; | |||
| CreateInfo.attachmentCount := Length(fAttachments); | |||
| CreateInfo.pAttachments := @fAttachments[0]; | |||
| CreateInfo.subpassCount := Length(fSubpasses); | |||
| CreateInfo.pSubpasses := @fSubpasses[0]; | |||
| CreateInfo.dependencyCount := Length(fDependencies); | |||
| CreateInfo.pDependencies := @fDependencies[0]; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuRenderPassEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuRenderPassEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuRenderPassEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuRenderPassEx(result).fOwnsHandler := aOwnsHandler; | |||
| except | |||
| FreeAndNil(result); | |||
| raise; | |||
| end; | |||
| end; | |||
| end. | |||
| @@ -7,7 +7,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, Controls, | |||
| Vulkan, uvkuInstance, uvkuSurface, uvkuAllocationHandler; | |||
| Vulkan, uvkuInstance, uvkuSurface, uvkuAllocationHandler, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -20,7 +20,7 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuSurfaceFactory = class(TObject) | |||
| TvkuSurfaceFactory = class(TvkuInstanceObjFactory) | |||
| {$IF DEFINED(VK_USE_PLATFORM_WIN32_KHR)} | |||
| private | |||
| fHInstance: Vulkan.HINSTANCE; | |||
| @@ -34,7 +34,6 @@ type | |||
| private | |||
| fFlags: VkFlags; | |||
| fWinControl: TWinControl; | |||
| fInstanceCommands: TVkInstanceCommands; | |||
| procedure SetWinControl(aValue: TWinControl); | |||
| public | |||
| property WinControl: TWinControl read fWinControl write SetWinControl; | |||
| @@ -45,8 +44,7 @@ type | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuSurfaceEx; | |||
| constructor Create(const aInstance: TvkuInstance); | |||
| constructor Create(const aInstanceCommands: TVkInstanceCommands); | |||
| procedure AfterConstruction; override; | |||
| end; | |||
| implementation | |||
| @@ -194,8 +192,8 @@ begin | |||
| CreateInfo.hwnd := fHwnd; | |||
| {$ENDIF} | |||
| if Assigned(aAllocHandler) | |||
| then srf := TvkuSurfaceEx.Create(CreateInfo, fInstanceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else srf := TvkuSurfaceEx.Create(CreateInfo, fInstanceCommands); | |||
| then srf := TvkuSurfaceEx.Create(CreateInfo, InstanceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else srf := TvkuSurfaceEx.Create(CreateInfo, InstanceCommands); | |||
| try | |||
| srf.fAllocHandler := aAllocHandler; | |||
| srf.fOwnsHandler := aOwnsHandler; | |||
| @@ -206,15 +204,9 @@ begin | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuSurfaceFactory.Create(const aInstance: TvkuInstance); | |||
| procedure TvkuSurfaceFactory.AfterConstruction; | |||
| begin | |||
| Create(aInstance.InstanceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuSurfaceFactory.Create(const aInstanceCommands: TVkInstanceCommands); | |||
| begin | |||
| inherited Create; | |||
| inherited AfterConstruction; | |||
| {$IF DEFINED(VK_USE_PLATFORM_XLIB_KHR)} | |||
| {$ERROR 'TODO: implement'} | |||
| {$ELSEIF DEFINED(VK_USE_PLATFORM_XCB_KHR)} | |||
| @@ -228,8 +220,7 @@ begin | |||
| {$ELSEIF DEFINED(VK_USE_PLATFORM_WIN32_KHR)} | |||
| fHInstance := Vulkan.HINSTANCE(GetModuleHandle(nil)); | |||
| {$ENDIF} | |||
| fInstanceCommands := aInstanceCommands; | |||
| fFlags := 0; | |||
| fFlags := 0; | |||
| end; | |||
| end. | |||
| @@ -6,7 +6,7 @@ interface | |||
| uses | |||
| Classes, SysUtils, | |||
| Vulkan, uvkuSwapChain, uvkuTypes, uvkuAllocationHandler, uvkuDevice; | |||
| Vulkan, uvkuSwapChain, uvkuTypes, uvkuAllocationHandler, uvkuDevice, uvkuFactoryBase; | |||
| type | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| @@ -19,10 +19,8 @@ type | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| TvkuSwapChainFactory = class(TObject) | |||
| TvkuSwapChainFactory = class(TvkuDeviceObjFactory) | |||
| private | |||
| fDeviceCommands: TVkDeviceCommands; | |||
| fFlags: VkSwapchainCreateFlagsKHR; | |||
| fSurface: VkSurfaceKHR; | |||
| fMinImageCount: VkUint32; | |||
| @@ -43,8 +41,6 @@ type | |||
| function GetQueueFamilyIndex(const aIndex: Integer): VkUint32; | |||
| procedure SetQueueFamilyIndex(const aIndex: Integer; aValue: VkUint32); | |||
| public | |||
| property DeviceCommands: TVkDeviceCommands read fDeviceCommands; | |||
| property Flags: VkSwapchainCreateFlagsKHR read fFlags write fFlags; | |||
| property Surface: VkSurfaceKHR read fSurface write fSurface; | |||
| property MinImageCount: VkUint32 read fMinImageCount write fMinImageCount; | |||
| @@ -69,8 +65,7 @@ type | |||
| const aAllocHandler: TvkuAllocationHandler; | |||
| const aOwnsHandler: Boolean): TvkuSwapChain; | |||
| constructor Create(const aDevice: TvkuDevice); | |||
| constructor Create(const aDeviceCommands: TVkDeviceCommands); | |||
| procedure AfterConstruction; override; | |||
| end; | |||
| implementation | |||
| @@ -146,8 +141,8 @@ begin | |||
| else CreateInfo.clipped := VK_FALSE; | |||
| if Assigned(aAllocHandler) | |||
| then result := TvkuSwapChainEx.Create(CreateInfo, fDeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuSwapChainEx.Create(CreateInfo, fDeviceCommands); | |||
| then result := TvkuSwapChainEx.Create(CreateInfo, DeviceCommands, aAllocHandler.GetAllocationCallbacksPtr) | |||
| else result := TvkuSwapChainEx.Create(CreateInfo, DeviceCommands); | |||
| try | |||
| TvkuSwapChainEx(result).fAllocHandler := aAllocHandler; | |||
| TvkuSwapChainEx(result).fOwnsHandler := aOwnsHandler; | |||
| @@ -158,17 +153,10 @@ begin | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuSwapChainFactory.Create(const aDevice: TvkuDevice); | |||
| begin | |||
| Create(aDevice.DeviceCommands); | |||
| end; | |||
| ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
| constructor TvkuSwapChainFactory.Create(const aDeviceCommands: TVkDeviceCommands); | |||
| procedure TvkuSwapChainFactory.AfterConstruction; | |||
| begin | |||
| inherited Create; | |||
| fDeviceCommands := aDeviceCommands; | |||
| fPresentMode := VK_PRESENT_MODE_FIFO_KHR; | |||
| inherited AfterConstruction; | |||
| fPresentMode := VK_PRESENT_MODE_FIFO_KHR; | |||
| end; | |||
| end. | |||
| @@ -22,6 +22,9 @@ type | |||
| TvkuDisplayArr = array of VkDisplayKHR; | |||
| TvkuDisplayModePropertiesArr = array of TVkDisplayModePropertiesKHR; | |||
| TvkuCommandBufferArr = array of VkCommandBuffer; | |||
| TvkuAttachmentDescriptionArr = array of TVkAttachmentDescription; | |||
| TvkuSubpassDescriptionArr = array of TVkSubpassDescription; | |||
| TvkuSubpassDependencyArr = array of TVkSubpassDependency; | |||
| TvkuApplicationInfo = packed record | |||
| AppName: String; | |||