mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
df0c4565d5
commit
e239da9978
|
@ -18,6 +18,7 @@ uses
|
||||||
vRender,
|
vRender,
|
||||||
vRenderPassManager,
|
vRenderPassManager,
|
||||||
vPipelineManager,
|
vPipelineManager,
|
||||||
|
vFramebufferManager,
|
||||||
vShader,
|
vShader,
|
||||||
vShaderExt,
|
vShaderExt,
|
||||||
vShaderManager,
|
vShaderManager,
|
||||||
|
@ -164,7 +165,9 @@ var
|
||||||
GP_KEY:TvGraphicsPipelineKey;
|
GP_KEY:TvGraphicsPipelineKey;
|
||||||
GP:TvGraphicsPipeline2;
|
GP:TvGraphicsPipeline2;
|
||||||
|
|
||||||
FFramebuffer:TvFramebufferIL;
|
FB_KEY:TvFramebufferImagelessKey;
|
||||||
|
FB_KEY2:TvFramebufferBindedKey;
|
||||||
|
FFramebuffer:TvFramebuffer;
|
||||||
|
|
||||||
FRenderCmd:TvRenderTargets;
|
FRenderCmd:TvRenderTargets;
|
||||||
|
|
||||||
|
@ -294,36 +297,47 @@ begin
|
||||||
|
|
||||||
GP:=FetchGraphicsPipeline(CmdBuffer,@GP_KEY);
|
GP:=FetchGraphicsPipeline(CmdBuffer,@GP_KEY);
|
||||||
|
|
||||||
FFramebuffer:=TvFramebufferIL.Create;
|
if limits.VK_KHR_imageless_framebuffer then
|
||||||
FFramebuffer.Key.FRenderPass :=RP;
|
begin
|
||||||
FFramebuffer.Key.FSize :=GPU_REGS.GET_SCREEN_SIZE;
|
FB_KEY:=Default(TvFramebufferImagelessKey);
|
||||||
|
|
||||||
|
FB_KEY.SetRenderPass(RP);
|
||||||
|
FB_KEY.SetSize(GPU_REGS.GET_SCREEN_SIZE);
|
||||||
|
|
||||||
if (RT_COUNT<>0) then
|
if (RT_COUNT<>0) then
|
||||||
For i:=0 to RT_COUNT-1 do
|
For i:=0 to RT_COUNT-1 do
|
||||||
begin
|
begin
|
||||||
FFramebuffer.Key.AddImageAt(RT_INFO[i].FImageInfo);
|
FB_KEY.AddImageAt(RT_INFO[i].FImageInfo);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if GPU_REGS.DB_ENABLE then
|
if GPU_REGS.DB_ENABLE then
|
||||||
begin
|
begin
|
||||||
FFramebuffer.Key.AddImageAt(DB_INFO.FImageInfo);
|
FB_KEY.AddImageAt(DB_INFO.FImageInfo);
|
||||||
end;
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FB_KEY2:=Default(TvFramebufferBindedKey);
|
||||||
|
|
||||||
FFramebuffer.Compile;
|
FB_KEY2.SetRenderPass(RP);
|
||||||
|
FB_KEY2.SetSize(GPU_REGS.GET_SCREEN_SIZE);
|
||||||
|
end;
|
||||||
|
|
||||||
FRenderCmd:=TvRenderTargets.Create;
|
FRenderCmd:=TvRenderTargets.Create;
|
||||||
|
|
||||||
FRenderCmd.FRenderPass:=RP;
|
FRenderCmd.FRenderPass:=RP;
|
||||||
FRenderCmd.FPipeline :=GP;
|
FRenderCmd.FPipeline :=GP;
|
||||||
|
|
||||||
FRenderCmd.FFramebuffer:=FFramebuffer;
|
|
||||||
|
|
||||||
FRenderCmd.FRenderArea:=GPU_REGS.GET_SCREEN;
|
FRenderCmd.FRenderArea:=GPU_REGS.GET_SCREEN;
|
||||||
|
|
||||||
|
if limits.VK_KHR_imageless_framebuffer then
|
||||||
|
begin
|
||||||
|
FFramebuffer:=FetchFramebufferImageless(CmdBuffer,@FB_KEY);
|
||||||
|
FRenderCmd.FFramebuffer:=FFramebuffer;
|
||||||
|
end;
|
||||||
|
|
||||||
if (RT_COUNT<>0) then
|
if (RT_COUNT<>0) then
|
||||||
For i:=0 to RT_COUNT-1 do
|
For i:=0 to RT_COUNT-1 do
|
||||||
begin
|
begin
|
||||||
//RT_INFO[i].CLEAR_COLOR.float32[2]:=1;
|
|
||||||
|
|
||||||
FRenderCmd.AddClearColor(RT_INFO[i].CLEAR_COLOR);
|
FRenderCmd.AddClearColor(RT_INFO[i].CLEAR_COLOR);
|
||||||
|
|
||||||
|
@ -335,7 +349,10 @@ begin
|
||||||
|
|
||||||
iv:=ri.FetchView(CmdBuffer,RT_INFO[i].FImageView,iu_attachment);
|
iv:=ri.FetchView(CmdBuffer,RT_INFO[i].FImageView,iu_attachment);
|
||||||
|
|
||||||
|
if limits.VK_KHR_imageless_framebuffer then
|
||||||
|
begin
|
||||||
FRenderCmd.AddImageView(iv);
|
FRenderCmd.AddImageView(iv);
|
||||||
|
end;
|
||||||
|
|
||||||
ri.PushBarrier(CmdBuffer,
|
ri.PushBarrier(CmdBuffer,
|
||||||
ord(VK_ACCESS_TRANSFER_READ_BIT),
|
ord(VK_ACCESS_TRANSFER_READ_BIT),
|
||||||
|
@ -348,6 +365,17 @@ begin
|
||||||
ord(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) or
|
ord(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) or
|
||||||
ord(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) );
|
ord(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) );
|
||||||
|
|
||||||
|
if not limits.VK_KHR_imageless_framebuffer then
|
||||||
|
begin
|
||||||
|
FB_KEY2.AddImageView(iv);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
if not limits.VK_KHR_imageless_framebuffer then
|
||||||
|
begin
|
||||||
|
FFramebuffer:=FetchFramebufferBinded(CmdBuffer,@FB_KEY2);
|
||||||
|
FRenderCmd.FFramebuffer:=FFramebuffer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if GPU_REGS.DB_ENABLE then
|
if GPU_REGS.DB_ENABLE then
|
||||||
|
|
|
@ -78,7 +78,7 @@ begin
|
||||||
ring^.wptr:=0;
|
ring^.wptr:=0;
|
||||||
ring^.aptr:=0;
|
ring^.aptr:=0;
|
||||||
|
|
||||||
Result:=md_reserve_ex(ring^.buff,size+GC_RING_PADD);
|
Result:=md_reserve_ex(ring^.buff,size shl 1);
|
||||||
if (Result<>0) then Exit;
|
if (Result<>0) then Exit;
|
||||||
|
|
||||||
Result:=md_split(ring^.buff,size);
|
Result:=md_split(ring^.buff,size);
|
||||||
|
@ -95,7 +95,7 @@ begin
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result:=md_file_mmap_ex(hMem,ring^.buff+size,0,GC_RING_PADD,MD_PROT_RW);
|
Result:=md_file_mmap_ex(hMem,ring^.buff+size,0,size,MD_PROT_RW);
|
||||||
|
|
||||||
md_memfd_close(hMem);
|
md_memfd_close(hMem);
|
||||||
end;
|
end;
|
||||||
|
@ -107,7 +107,7 @@ begin
|
||||||
if (ring^.buff=nil) then Exit;
|
if (ring^.buff=nil) then Exit;
|
||||||
if (ring^.size=0) then Exit;
|
if (ring^.size=0) then Exit;
|
||||||
|
|
||||||
Result:=md_unmap_ex(ring^.buff,ring^.size+GC_RING_PADD);
|
Result:=md_unmap_ex(ring^.buff,ring^.size shl 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function block_id(val,size:DWORD):DWORD; inline;
|
function block_id(val,size:DWORD):DWORD; inline;
|
||||||
|
@ -177,9 +177,7 @@ begin
|
||||||
s:=block_ofs(wptr,rsiz)-block_ofs(rptr,rsiz);
|
s:=block_ofs(wptr,rsiz)-block_ofs(rptr,rsiz);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
s:=block_ofs(wptr,rsiz);
|
s:=(rsiz-block_ofs(rptr,rsiz))+block_ofs(wptr,rsiz);
|
||||||
if (s>GC_RING_PADD) then s:=GC_RING_PADD;
|
|
||||||
s:=(rsiz-block_ofs(rptr,rsiz))+s;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (s<>0) then
|
if (s<>0) then
|
||||||
|
|
|
@ -994,6 +994,10 @@
|
||||||
<Filename Value="vulkan\vPipelineManager.pas"/>
|
<Filename Value="vulkan\vPipelineManager.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
</Unit>
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="vulkan\vFramebufferManager.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
|
|
@ -254,8 +254,8 @@ end;
|
||||||
|
|
||||||
function TvCmdBuffer.BeginRenderPass(RT:TvRenderTargets):Boolean;
|
function TvCmdBuffer.BeginRenderPass(RT:TvRenderTargets):Boolean;
|
||||||
var
|
var
|
||||||
info:TVkRenderPassBeginInfo;
|
rinfo:TVkRenderPassBeginInfo;
|
||||||
info2:TVkRenderPassAttachmentBeginInfo;
|
ainfo:TVkRenderPassAttachmentBeginInfo;
|
||||||
begin
|
begin
|
||||||
Result:=False;
|
Result:=False;
|
||||||
|
|
||||||
|
@ -281,10 +281,13 @@ begin
|
||||||
|
|
||||||
EndRenderPass;
|
EndRenderPass;
|
||||||
|
|
||||||
info:=RT.GetInfo;
|
rinfo:=RT.GetRInfo;
|
||||||
info2:=RT.GetInfo2;
|
|
||||||
|
|
||||||
info.pNext:=@info2;
|
if RT.FFramebuffer.IsImageless then
|
||||||
|
begin
|
||||||
|
ainfo:=RT.GetAInfo;
|
||||||
|
rinfo.pNext:=@ainfo;
|
||||||
|
end;
|
||||||
|
|
||||||
FCurrPipeline[0]:=RT.FPipeline.FHandle;
|
FCurrPipeline[0]:=RT.FPipeline.FHandle;
|
||||||
FCurrLayout [0]:=RT.FPipeline.Key.FShaderGroup.FLayout.FHandle;
|
FCurrLayout [0]:=RT.FPipeline.Key.FShaderGroup.FLayout.FHandle;
|
||||||
|
@ -292,7 +295,7 @@ begin
|
||||||
|
|
||||||
Inc(cmd_count);
|
Inc(cmd_count);
|
||||||
|
|
||||||
vkCmdBeginRenderPass(FCmdbuf,@info,VK_SUBPASS_CONTENTS_INLINE);
|
vkCmdBeginRenderPass(FCmdbuf,@rinfo,VK_SUBPASS_CONTENTS_INLINE);
|
||||||
vkCmdBindPipeline (FCmdbuf,VK_PIPELINE_BIND_POINT_GRAPHICS,FCurrPipeline[0]);
|
vkCmdBindPipeline (FCmdbuf,VK_PIPELINE_BIND_POINT_GRAPHICS,FCurrPipeline[0]);
|
||||||
|
|
||||||
if AddDependence(@RT.Release) then
|
if AddDependence(@RT.Release) then
|
||||||
|
@ -300,7 +303,7 @@ begin
|
||||||
RT.Acquire(Self);
|
RT.Acquire(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FRenderPass:=info.renderPass;
|
FRenderPass:=rinfo.renderPass;
|
||||||
|
|
||||||
Result:=True;
|
Result:=True;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -0,0 +1,260 @@
|
||||||
|
unit vFramebufferManager;
|
||||||
|
|
||||||
|
{$mode ObjFPC}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,
|
||||||
|
mqueue,
|
||||||
|
g23tree,
|
||||||
|
vDependence,
|
||||||
|
vImage;
|
||||||
|
|
||||||
|
type
|
||||||
|
TvFramebufferImageless2=class(TvFramebufferImageless)
|
||||||
|
FRefs:ptruint;
|
||||||
|
Procedure Acquire;
|
||||||
|
procedure Release(Sender:TObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
TvFramebufferBinded2=class(TvFramebufferBinded)
|
||||||
|
FEntry:TAILQ_ENTRY;
|
||||||
|
FRefs:ptruint;
|
||||||
|
Procedure Acquire;
|
||||||
|
procedure Release(Sender:TObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function FetchFramebufferImageless(cmd:TvDependenciesObject;P:PvFramebufferImagelessKey):TvFramebufferImageless2;
|
||||||
|
function FetchFramebufferBinded (cmd:TvDependenciesObject;P:PvFramebufferBindedKey ):TvFramebufferBinded2;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
kern_rwlock;
|
||||||
|
|
||||||
|
type
|
||||||
|
TvFramebufferImagelessKey2Compare=object
|
||||||
|
function c(a,b:PvFramebufferImagelessKey):Integer; static;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TvFramebufferImageless2Set=specialize T23treeSet<PvFramebufferImagelessKey,TvFramebufferImagelessKey2Compare>;
|
||||||
|
|
||||||
|
TvFramebufferBinded2Set=object
|
||||||
|
const
|
||||||
|
MaxCount=256;
|
||||||
|
var
|
||||||
|
Queue:TAILQ_HEAD;
|
||||||
|
Count:Ptruint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
global_lock:Pointer=nil;
|
||||||
|
|
||||||
|
FFramebufferImageless2Set:TvFramebufferImageless2Set;
|
||||||
|
|
||||||
|
FFramebufferBinded:TvFramebufferBinded2Set=(
|
||||||
|
Queue:(tqh_first:nil;tqh_last:@FFramebufferBinded.Queue.tqh_first);
|
||||||
|
Count:0
|
||||||
|
);
|
||||||
|
|
||||||
|
function TvFramebufferImagelessKey2Compare.c(a,b:PvFramebufferImagelessKey):Integer;
|
||||||
|
begin
|
||||||
|
Result:=CompareByte(a^,b^,SizeOf(TvFramebufferImagelessKey));
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TvFramebufferImageless2.Acquire;
|
||||||
|
begin
|
||||||
|
System.InterlockedIncrement(Pointer(FRefs));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TvFramebufferImageless2.Release(Sender:TObject);
|
||||||
|
begin
|
||||||
|
if System.InterlockedDecrement(Pointer(FRefs))=nil then
|
||||||
|
begin
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TvFramebufferBinded2.Acquire;
|
||||||
|
begin
|
||||||
|
System.InterlockedIncrement(Pointer(FRefs));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TvFramebufferBinded2.Release(Sender:TObject);
|
||||||
|
begin
|
||||||
|
if System.InterlockedDecrement(Pointer(FRefs))=nil then
|
||||||
|
begin
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure Global_Lock_wr;
|
||||||
|
begin
|
||||||
|
rw_wlock(global_lock);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure Global_Unlock_wr;
|
||||||
|
begin
|
||||||
|
rw_wunlock(global_lock);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _FindImageless(P:PvFramebufferImagelessKey):TvFramebufferImageless2;
|
||||||
|
var
|
||||||
|
i:TvFramebufferImageless2Set.Iterator;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
i:=FFramebufferImageless2Set.find(P);
|
||||||
|
if (i.Item<>nil) then
|
||||||
|
begin
|
||||||
|
Result:=TvFramebufferImageless2(ptruint(i.Item^)-ptruint(@TvFramebufferImageless2(nil).key));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _FetchImageless(P:PvFramebufferImagelessKey):TvFramebufferImageless2;
|
||||||
|
var
|
||||||
|
t:TvFramebufferImageless2;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
|
||||||
|
t:=_FindImageless(P);
|
||||||
|
|
||||||
|
if (t=nil) then
|
||||||
|
begin
|
||||||
|
|
||||||
|
t:=TvFramebufferImageless2.Create;
|
||||||
|
t.key:=P^;
|
||||||
|
|
||||||
|
if not t.Compile then
|
||||||
|
begin
|
||||||
|
FreeAndNil(t);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
t.Acquire; //map ref
|
||||||
|
FFramebufferImageless2Set.Insert(@t.key);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result:=t;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function FetchFramebufferImageless(cmd:TvDependenciesObject;P:PvFramebufferImagelessKey):TvFramebufferImageless2;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
if (P=nil) then Exit;
|
||||||
|
|
||||||
|
Global_Lock_wr;
|
||||||
|
|
||||||
|
Result:=_FetchImageless(P);
|
||||||
|
|
||||||
|
if (cmd<>nil) and (Result<>nil) then
|
||||||
|
begin
|
||||||
|
if cmd.AddDependence(@Result.Release) then
|
||||||
|
begin
|
||||||
|
Result.Acquire;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Global_Unlock_wr;
|
||||||
|
end;
|
||||||
|
|
||||||
|
///
|
||||||
|
|
||||||
|
function _FindBinded(P:PvFramebufferBindedKey):TvFramebufferBinded2;
|
||||||
|
var
|
||||||
|
node:TvFramebufferBinded2;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
|
||||||
|
node:=TvFramebufferBinded2(TAILQ_FIRST(@FFramebufferBinded.Queue));
|
||||||
|
|
||||||
|
while (node<>nil) do
|
||||||
|
begin
|
||||||
|
|
||||||
|
if (CompareByte(P^,node.Key,SizeOf(TvFramebufferBindedKey))=0) then
|
||||||
|
begin
|
||||||
|
if (node<>TvFramebufferBinded2(TAILQ_FIRST(@FFramebufferBinded.Queue))) then
|
||||||
|
begin
|
||||||
|
//set to top
|
||||||
|
TAILQ_REMOVE (@FFramebufferBinded.Queue,node,@node.FEntry);
|
||||||
|
TAILQ_INSERT_HEAD(@FFramebufferBinded.Queue,node,@node.FEntry);
|
||||||
|
end;
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
|
||||||
|
node:=TvFramebufferBinded2(TAILQ_NEXT(node,@node.FEntry));
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure _BoundBinded;
|
||||||
|
var
|
||||||
|
node:TvFramebufferBinded2;
|
||||||
|
begin
|
||||||
|
if (FFramebufferBinded.Count>FFramebufferBinded.MaxCount) then
|
||||||
|
begin
|
||||||
|
node:=TvFramebufferBinded2(TAILQ_LAST(@FFramebufferBinded.Queue));
|
||||||
|
|
||||||
|
if (node<>nil) then
|
||||||
|
begin
|
||||||
|
TAILQ_REMOVE(@FFramebufferBinded.Queue,node,@node.FEntry);
|
||||||
|
node.Release(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Dec(FFramebufferBinded.Count);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function _FetchBinded(P:PvFramebufferBindedKey):TvFramebufferBinded2;
|
||||||
|
var
|
||||||
|
t:TvFramebufferBinded2;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
|
||||||
|
t:=_FindBinded(P);
|
||||||
|
|
||||||
|
if (t=nil) then
|
||||||
|
begin
|
||||||
|
|
||||||
|
t:=TvFramebufferBinded2.Create;
|
||||||
|
t.key:=P^;
|
||||||
|
|
||||||
|
if not t.Compile then
|
||||||
|
begin
|
||||||
|
FreeAndNil(t);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
t.Acquire; //map ref
|
||||||
|
TAILQ_INSERT_HEAD(@FFramebufferBinded.Queue,t,@t.FEntry);
|
||||||
|
Inc(FFramebufferBinded.Count);
|
||||||
|
|
||||||
|
_BoundBinded;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result:=t;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function FetchFramebufferBinded(cmd:TvDependenciesObject;P:PvFramebufferBindedKey):TvFramebufferBinded2;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
if (P=nil) then Exit;
|
||||||
|
|
||||||
|
Global_Lock_wr;
|
||||||
|
|
||||||
|
Result:=_FetchBinded(P);
|
||||||
|
|
||||||
|
if (cmd<>nil) and (Result<>nil) then
|
||||||
|
begin
|
||||||
|
if cmd.AddDependence(@Result.Release) then
|
||||||
|
begin
|
||||||
|
Result.Acquire;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Global_Unlock_wr;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
|
@ -160,40 +160,64 @@ type
|
||||||
function GetImageInfo:TVkImageCreateInfo; override;
|
function GetImageInfo:TVkImageCreateInfo; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AvFramebufferImages=array[0..8] of TvImageView;
|
TvFramebufferAttachmentShort=packed record
|
||||||
|
cformat :TVkFormat;
|
||||||
|
width :Word;
|
||||||
|
height :Word;
|
||||||
|
layerCount:Word;
|
||||||
|
end;
|
||||||
|
|
||||||
AvFramebufferAttach=array[0..8] of TVkFramebufferAttachmentImageInfo;
|
AvFramebufferAttach=array[0..8] of TVkFramebufferAttachmentImageInfo;
|
||||||
|
AvFramebufferAShort=array[0..8] of TvFramebufferAttachmentShort;
|
||||||
|
|
||||||
|
AvFramebufferImages=array[0..8] of TvImageView;
|
||||||
AvImageViews =array[0..8] of TVkImageView;
|
AvImageViews =array[0..8] of TVkImageView;
|
||||||
|
|
||||||
TvFramebuffer=class
|
TvFramebuffer=class
|
||||||
FHandle:TVkFramebuffer;
|
FHandle:TVkFramebuffer;
|
||||||
|
function IsImageless:Boolean; virtual;
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
PvFramebufferImagelessKey=^TvFramebufferImagelessKey;
|
||||||
TvFramebufferImagelessKey=packed object
|
TvFramebufferImagelessKey=packed object
|
||||||
FRenderPass :TvRenderPass;
|
FRenderPass :TvRenderPass;
|
||||||
FSize :TVkExtent2D;
|
FWidth :Word;
|
||||||
FImagesCount:ptruint;
|
FHeight :Word;
|
||||||
FImages :AvFramebufferAttach;
|
FLayers :Word;
|
||||||
|
FImagesCount:Word;
|
||||||
|
FImages :AvFramebufferAShort;
|
||||||
|
Procedure SetRenderPass(r:TvRenderPass);
|
||||||
|
Procedure SetSize(Size:TVkExtent2D);
|
||||||
Procedure AddImageAt(Key:TvImageKey);
|
Procedure AddImageAt(Key:TvImageKey);
|
||||||
|
Procedure Export(var F:AvFramebufferAttach);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TvFramebufferIL=class(TvFramebuffer)
|
TvFramebufferImageless=class(TvFramebuffer)
|
||||||
Key:TvFramebufferImagelessKey;
|
Key:TvFramebufferImagelessKey;
|
||||||
|
function IsImageless:Boolean; override;
|
||||||
function Compile:Boolean;
|
function Compile:Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TvFramebufferIV=class(TvFramebuffer)
|
PvFramebufferBindedKey=^TvFramebufferBindedKey;
|
||||||
FEdit,FCompile:ptruint;
|
TvFramebufferBindedKey=packed object
|
||||||
FRenderPass :TvRenderPass;
|
FRenderPass :TvRenderPass;
|
||||||
FSize :TVkExtent2D;
|
FWidth :Word;
|
||||||
FImagesCount:ptruint;
|
FHeight :Word;
|
||||||
|
FLayers :Word;
|
||||||
|
FImagesCount:Word;
|
||||||
FImages :AvFramebufferImages;
|
FImages :AvFramebufferImages;
|
||||||
Procedure SetRenderPass(r:TvRenderPass);
|
Procedure SetRenderPass(r:TvRenderPass);
|
||||||
Procedure SetSize(Size:TVkExtent2D);
|
Procedure SetSize(Size:TVkExtent2D);
|
||||||
Procedure AddImageView(v:TvImageView);
|
Procedure AddImageView(v:TvImageView);
|
||||||
Procedure FreeImageViews;
|
end;
|
||||||
function IsEdit:Boolean;
|
|
||||||
|
TvFramebufferBinded=class(TvFramebuffer)
|
||||||
|
Key:TvFramebufferBindedKey;
|
||||||
|
FAcquire:bitpacked array[0..8] of Boolean;
|
||||||
function Compile:Boolean;
|
function Compile:Boolean;
|
||||||
|
Procedure AcquireImageViews;
|
||||||
|
Procedure ReleaseImageViews;
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -321,6 +345,11 @@ end;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
function TvFramebuffer.IsImageless:Boolean;
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
Destructor TvFramebuffer.Destroy;
|
Destructor TvFramebuffer.Destroy;
|
||||||
begin
|
begin
|
||||||
if (FHandle<>VK_NULL_HANDLE) then
|
if (FHandle<>VK_NULL_HANDLE) then
|
||||||
|
@ -332,55 +361,24 @@ end;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
Procedure TvFramebufferIV.SetRenderPass(r:TvRenderPass);
|
Procedure TvFramebufferBindedKey.SetRenderPass(r:TvRenderPass);
|
||||||
begin
|
begin
|
||||||
if (r=FRenderPass) then Exit;
|
|
||||||
FRenderPass:=r;
|
FRenderPass:=r;
|
||||||
Inc(FEdit);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TvFramebufferIV.SetSize(Size:TVkExtent2D);
|
Procedure TvFramebufferBindedKey.SetSize(Size:TVkExtent2D);
|
||||||
begin
|
begin
|
||||||
if CompareByte(Size,FSize,SizeOf(TVkExtent2D))=0 then Exit;
|
FWidth :=Size.width;
|
||||||
FSize:=Size;
|
FHeight:=Size.height;
|
||||||
Inc(FEdit);
|
FLayers:=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TvFramebufferIV.AddImageView(v:TvImageView);
|
Procedure TvFramebufferBindedKey.AddImageView(v:TvImageView);
|
||||||
begin
|
begin
|
||||||
if (v=nil) then Exit;
|
if (v=nil) then Exit;
|
||||||
if (FImagesCount>=Length(AvFramebufferImages)) then Exit;
|
if (FImagesCount>=Length(AvFramebufferImages)) then Exit;
|
||||||
FImages[FImagesCount]:=v;
|
FImages[FImagesCount]:=v;
|
||||||
Inc(FImagesCount);
|
Inc(FImagesCount);
|
||||||
v.Acquire;
|
|
||||||
Inc(FEdit);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Procedure TvFramebufferIV.FreeImageViews;
|
|
||||||
var
|
|
||||||
i:Integer;
|
|
||||||
begin
|
|
||||||
if (FImagesCount<>0) then
|
|
||||||
For i:=0 to FImagesCount-1 do
|
|
||||||
if (FImages[i]<>nil) then
|
|
||||||
begin
|
|
||||||
FImages[i].Release;
|
|
||||||
FImages[i]:=nil;
|
|
||||||
end;
|
|
||||||
FImagesCount:=0;
|
|
||||||
|
|
||||||
//It:=FImages.cbegin;
|
|
||||||
//if (It.Item<>nil) then
|
|
||||||
//repeat
|
|
||||||
// TvImageView(It.Item^).Release;
|
|
||||||
//until not It.Next;
|
|
||||||
//FImages.Free;
|
|
||||||
Inc(FEdit);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TvFramebufferIV.IsEdit:Boolean;
|
|
||||||
begin
|
|
||||||
Result:=(FEdit<>FCompile);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -893,37 +891,90 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Procedure TvFramebufferImagelessKey.SetRenderPass(r:TvRenderPass);
|
||||||
|
begin
|
||||||
|
FRenderPass:=r;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TvFramebufferImagelessKey.SetSize(Size:TVkExtent2D);
|
||||||
|
begin
|
||||||
|
FWidth :=Size.width;
|
||||||
|
FHeight:=Size.height;
|
||||||
|
FLayers:=1;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TvFramebufferImagelessKey.AddImageAt(Key:TvImageKey);
|
Procedure TvFramebufferImagelessKey.AddImageAt(Key:TvImageKey);
|
||||||
var
|
|
||||||
MUTABLE:PVkFormat;
|
|
||||||
begin
|
begin
|
||||||
if (FImagesCount>=Length(FImages)) then Exit;
|
if (FImagesCount>=Length(FImages)) then Exit;
|
||||||
|
|
||||||
MUTABLE:=GET_VK_IMAGE_MUTABLE(Key.cformat);
|
if (Key.params.width>FWidth) then
|
||||||
|
begin
|
||||||
|
FWidth:=Key.params.width;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (Key.params.height>FHeight) then
|
||||||
|
begin
|
||||||
|
FHeight:=Key.params.height;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (Key.params.arrayLayers>FLayers) then
|
||||||
|
begin
|
||||||
|
FLayers:=Key.params.arrayLayers;
|
||||||
|
end;
|
||||||
|
|
||||||
with FImages[FImagesCount] do
|
with FImages[FImagesCount] do
|
||||||
begin
|
begin
|
||||||
sType :=VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO;
|
cformat :=Key.cformat;
|
||||||
pNext :=nil;
|
|
||||||
flags :=GET_VK_IMAGE_CREATE_DEFAULT(Key.cformat);
|
|
||||||
usage :=GET_VK_IMAGE_USAGE_DEFAULT (Key.cformat);
|
|
||||||
width :=Key.params.width;
|
width :=Key.params.width;
|
||||||
height :=Key.params.height;
|
height :=Key.params.height;
|
||||||
layerCount :=key.params.arrayLayers;
|
layerCount:=key.params.arrayLayers;
|
||||||
viewFormatCount:=GET_FORMATS_LEN(MUTABLE);
|
|
||||||
pViewFormats :=MUTABLE;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Inc(FImagesCount);
|
Inc(FImagesCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Procedure TvFramebufferImagelessKey.Export(var F:AvFramebufferAttach);
|
||||||
|
var
|
||||||
|
cformat:TVkFormat;
|
||||||
|
MUTABLE:PVkFormat;
|
||||||
|
i:Word;
|
||||||
|
begin
|
||||||
|
|
||||||
|
if (FImagesCount<>0) then
|
||||||
|
For i:=0 to FImagesCount-1 do
|
||||||
|
begin
|
||||||
|
cformat:=FImages[i].cformat;
|
||||||
|
MUTABLE:=GET_VK_IMAGE_MUTABLE(cformat);
|
||||||
|
|
||||||
|
with F[i] do
|
||||||
|
begin
|
||||||
|
sType :=VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO;
|
||||||
|
pNext :=nil;
|
||||||
|
flags :=GET_VK_IMAGE_CREATE_DEFAULT(cformat);
|
||||||
|
usage :=GET_VK_IMAGE_USAGE_DEFAULT (cformat);
|
||||||
|
width :=FImages[i].width;
|
||||||
|
height :=FImages[i].height;
|
||||||
|
layerCount :=FImages[i].layerCount;
|
||||||
|
viewFormatCount:=GET_FORMATS_LEN(MUTABLE);
|
||||||
|
pViewFormats :=MUTABLE;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
function TvFramebufferIL.Compile:Boolean;
|
function TvFramebufferImageless.IsImageless:Boolean;
|
||||||
|
begin
|
||||||
|
Result:=True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TvFramebufferImageless.Compile:Boolean;
|
||||||
var
|
var
|
||||||
r:TVkResult;
|
r:TVkResult;
|
||||||
info:TVkFramebufferCreateInfo;
|
info:TVkFramebufferCreateInfo;
|
||||||
imgs:TVkFramebufferAttachmentsCreateInfo;
|
imgs:TVkFramebufferAttachmentsCreateInfo;
|
||||||
|
fatt:AvFramebufferAttach;
|
||||||
begin
|
begin
|
||||||
Result:=False;
|
Result:=False;
|
||||||
if (FHandle<>VK_NULL_HANDLE) then Exit(True);
|
if (FHandle<>VK_NULL_HANDLE) then Exit(True);
|
||||||
|
@ -931,22 +982,24 @@ begin
|
||||||
if (Key.FRenderPass=nil) then Exit;
|
if (Key.FRenderPass=nil) then Exit;
|
||||||
if (Key.FRenderPass.FHandle=VK_NULL_HANDLE) then Exit;
|
if (Key.FRenderPass.FHandle=VK_NULL_HANDLE) then Exit;
|
||||||
if (Key.FImagesCount=0) then Exit;
|
if (Key.FImagesCount=0) then Exit;
|
||||||
if (Key.FSize.width=0) or (Key.FSize.height=0) then Exit;
|
if (Key.FWidth=0) or (Key.FHeight=0) then Exit;
|
||||||
|
|
||||||
info:=Default(TVkFramebufferCreateInfo);
|
info:=Default(TVkFramebufferCreateInfo);
|
||||||
info.sType :=VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
info.sType :=VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
||||||
info.renderPass :=Key.FRenderPass.FHandle;
|
info.renderPass :=Key.FRenderPass.FHandle;
|
||||||
info.attachmentCount:=Key.FImagesCount;
|
info.attachmentCount:=Key.FImagesCount;
|
||||||
info.width :=Key.FSize.width;
|
info.width :=Key.FWidth;
|
||||||
info.height :=Key.FSize.height;
|
info.height :=Key.FHeight;
|
||||||
info.layers :=1;
|
info.layers :=Key.FLayers;
|
||||||
info.flags :=ord(VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT);
|
info.flags :=ord(VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT);
|
||||||
info.pAttachments :=nil;
|
info.pAttachments :=nil;
|
||||||
|
|
||||||
|
Key.Export(fatt);
|
||||||
|
|
||||||
imgs:=Default(TVkFramebufferAttachmentsCreateInfo);
|
imgs:=Default(TVkFramebufferAttachmentsCreateInfo);
|
||||||
imgs.sType:=VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO;
|
imgs.sType:=VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO;
|
||||||
imgs.attachmentImageInfoCount:=Key.FImagesCount;
|
imgs.attachmentImageInfoCount:=Key.FImagesCount;
|
||||||
imgs.pAttachmentImageInfos :=@Key.FImages;
|
imgs.pAttachmentImageInfos :=@fatt;
|
||||||
|
|
||||||
info.pNext:=@imgs;
|
info.pNext:=@imgs;
|
||||||
|
|
||||||
|
@ -961,7 +1014,35 @@ end;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
function TvFramebufferIV.Compile:Boolean;
|
Procedure TvFramebufferBinded.AcquireImageViews;
|
||||||
|
var
|
||||||
|
i:Word;
|
||||||
|
begin
|
||||||
|
if (Key.FImagesCount<>0) then
|
||||||
|
For i:=0 to Key.FImagesCount-1 do
|
||||||
|
if (Key.FImages[i]<>nil) then
|
||||||
|
if (not FAcquire[i]) then
|
||||||
|
begin
|
||||||
|
Key.FImages[i].Acquire;
|
||||||
|
FAcquire[i]:=True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TvFramebufferBinded.ReleaseImageViews;
|
||||||
|
var
|
||||||
|
i:Word;
|
||||||
|
begin
|
||||||
|
if (Key.FImagesCount<>0) then
|
||||||
|
For i:=0 to Key.FImagesCount-1 do
|
||||||
|
if (Key.FImages[i]<>nil) then
|
||||||
|
if (FAcquire[i]) then
|
||||||
|
begin
|
||||||
|
Key.FImages[i].Release;
|
||||||
|
FAcquire[i]:=False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TvFramebufferBinded.Compile:Boolean;
|
||||||
var
|
var
|
||||||
i:TVkUInt32;
|
i:TVkUInt32;
|
||||||
r:TVkResult;
|
r:TVkResult;
|
||||||
|
@ -969,32 +1050,29 @@ var
|
||||||
FImageViews:AvImageViews;
|
FImageViews:AvImageViews;
|
||||||
begin
|
begin
|
||||||
Result:=False;
|
Result:=False;
|
||||||
if (not IsEdit) then Exit(true);
|
if (FHandle<>VK_NULL_HANDLE) then Exit(True);
|
||||||
if (FRenderPass=nil) then Exit;
|
|
||||||
if (FRenderPass.FHandle=VK_NULL_HANDLE) then Exit;
|
|
||||||
if (FImagesCount=0) then Exit;
|
|
||||||
if (FSize.width=0) or (FSize.height=0) then Exit;
|
|
||||||
|
|
||||||
if (FHandle<>VK_NULL_HANDLE) then
|
if (Key.FRenderPass=nil) then Exit;
|
||||||
begin
|
if (Key.FRenderPass.FHandle=VK_NULL_HANDLE) then Exit;
|
||||||
vkDestroyFramebuffer(Device.FHandle,FHandle,nil);
|
if (Key.FImagesCount=0) then Exit;
|
||||||
FHandle:=VK_NULL_HANDLE;
|
if (Key.FWidth=0) or (Key.FHeight=0) then Exit;
|
||||||
end;
|
|
||||||
|
AcquireImageViews;
|
||||||
|
|
||||||
info:=Default(TVkFramebufferCreateInfo);
|
info:=Default(TVkFramebufferCreateInfo);
|
||||||
info.sType :=VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
info.sType :=VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
||||||
info.renderPass :=FRenderPass.FHandle;
|
info.renderPass :=Key.FRenderPass.FHandle;
|
||||||
info.attachmentCount:=FImagesCount;
|
info.attachmentCount:=Key.FImagesCount;
|
||||||
info.width :=FSize.width;
|
info.width :=Key.FWidth;
|
||||||
info.height :=FSize.height;
|
info.height :=Key.FHeight;
|
||||||
info.layers :=1;
|
info.layers :=Key.FLayers;
|
||||||
|
|
||||||
FImageViews:=Default(AvImageViews);
|
FImageViews:=Default(AvImageViews);
|
||||||
|
|
||||||
For i:=0 to FImagesCount-1 do
|
For i:=0 to Key.FImagesCount-1 do
|
||||||
if (FImages[i]<>nil) then
|
if (Key.FImages[i]<>nil) then
|
||||||
begin
|
begin
|
||||||
FImageViews[i]:=FImages[i].FHandle;
|
FImageViews[i]:=Key.FImages[i].FHandle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
info.pAttachments:=@FImageViews;
|
info.pAttachments:=@FImageViews;
|
||||||
|
@ -1008,9 +1086,9 @@ begin
|
||||||
Result:=(r=VK_SUCCESS);
|
Result:=(r=VK_SUCCESS);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Destructor TvFramebufferIV.Destroy;
|
Destructor TvFramebufferBinded.Destroy;
|
||||||
begin
|
begin
|
||||||
FreeImageViews;
|
ReleaseImageViews;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -393,7 +393,7 @@ begin
|
||||||
t.Parent :=Self;
|
t.Parent :=Self;
|
||||||
t.key :=key2;
|
t.key :=key2;
|
||||||
|
|
||||||
t.Acquire;
|
t.Acquire; //map ref
|
||||||
FViews.Insert(@t.key);
|
FViews.Insert(@t.key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -150,9 +150,9 @@ const
|
||||||
handleTypes:ord(VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT);
|
handleTypes:ord(VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT);
|
||||||
);
|
);
|
||||||
|
|
||||||
function vkAllocMemory(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32):TVkDeviceMemory;
|
function vkAllocMemory (device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32):TVkDeviceMemory;
|
||||||
function vkAllocHostMemory(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;adr:Pointer):TVkDeviceMemory;
|
function vkAllocHostMemory (device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;addr:Pointer ):TVkDeviceMemory;
|
||||||
function vkAllocDedicatedImage(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;FHandle:TVkImage):TVkDeviceMemory;
|
function vkAllocDedicatedImage (device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;FHandle:TVkImage ):TVkDeviceMemory;
|
||||||
function vkAllocDedicatedBuffer(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;FHandle:TVkBuffer):TVkDeviceMemory;
|
function vkAllocDedicatedBuffer(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;FHandle:TVkBuffer):TVkDeviceMemory;
|
||||||
|
|
||||||
function GetHostMappedRequirements:TVkMemoryRequirements;
|
function GetHostMappedRequirements:TVkMemoryRequirements;
|
||||||
|
@ -1136,7 +1136,7 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function vkAllocHostMemory(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;adr:Pointer):TVkDeviceMemory;
|
function vkAllocHostMemory(device:TVkDevice;Size:TVkDeviceSize;mtindex:TVkUInt32;addr:Pointer):TVkDeviceMemory;
|
||||||
var
|
var
|
||||||
ainfo:TVkMemoryAllocateInfo;
|
ainfo:TVkMemoryAllocateInfo;
|
||||||
import:TVkImportMemoryHostPointerInfoEXT;
|
import:TVkImportMemoryHostPointerInfoEXT;
|
||||||
|
@ -1151,7 +1151,7 @@ begin
|
||||||
import:=Default(TVkImportMemoryHostPointerInfoEXT);
|
import:=Default(TVkImportMemoryHostPointerInfoEXT);
|
||||||
import.sType :=VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT;
|
import.sType :=VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT;
|
||||||
import.handleType :=VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
|
import.handleType :=VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
|
||||||
import.pHostPointer:=adr;
|
import.pHostPointer:=addr;
|
||||||
//
|
//
|
||||||
Result:=VK_NULL_HANDLE;
|
Result:=VK_NULL_HANDLE;
|
||||||
r:=vkAllocateMemory(device,@ainfo,nil,@Result);
|
r:=vkAllocateMemory(device,@ainfo,nil,@Result);
|
||||||
|
|
|
@ -251,13 +251,6 @@ begin
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
//VK_EXT_vertex_input_dynamic_state
|
|
||||||
//VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME
|
|
||||||
// VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT
|
|
||||||
// VK_DYNAMIC_STATE_VERTEX_INPUT_EXT
|
|
||||||
// VkVertexInputBindingDescription2EXT
|
|
||||||
// VkVertexInputAttributeDescription2EXT
|
|
||||||
|
|
||||||
vertexInputInfo:=Default(TVkPipelineVertexInputStateCreateInfo);
|
vertexInputInfo:=Default(TVkPipelineVertexInputStateCreateInfo);
|
||||||
vertexInputInfo.sType :=VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
|
vertexInputInfo.sType :=VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
|
||||||
vertexInputInfo.vertexBindingDescriptionCount :=Key.vertexInputInfo.vertexBindingDescriptionCount;
|
vertexInputInfo.vertexBindingDescriptionCount :=Key.vertexInputInfo.vertexBindingDescriptionCount;
|
||||||
|
@ -388,7 +381,7 @@ begin
|
||||||
FreeAndNil(t);
|
FreeAndNil(t);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
t.Acquire;
|
t.Acquire; //map ref
|
||||||
FGraphicsPipeline2Set.Insert(@t.key);
|
FGraphicsPipeline2Set.Insert(@t.key);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -102,8 +102,8 @@ type
|
||||||
Procedure AddClearColor(clr:TVkClearValue);
|
Procedure AddClearColor(clr:TVkClearValue);
|
||||||
Procedure AddClearColor(clr:TVkClearColorValue);
|
Procedure AddClearColor(clr:TVkClearColorValue);
|
||||||
Procedure AddImageView(v:TvImageView);
|
Procedure AddImageView(v:TvImageView);
|
||||||
Function GetInfo:TVkRenderPassBeginInfo;
|
Function GetRInfo:TVkRenderPassBeginInfo;
|
||||||
Function GetInfo2:TVkRenderPassAttachmentBeginInfo;
|
Function GetAInfo:TVkRenderPassAttachmentBeginInfo;
|
||||||
class function c(const a,b:TvRenderTargets):Integer;
|
class function c(const a,b:TvRenderTargets):Integer;
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
Procedure Acquire(Sender:TObject);
|
Procedure Acquire(Sender:TObject);
|
||||||
|
@ -624,7 +624,7 @@ begin
|
||||||
Inc(FImagesCount);
|
Inc(FImagesCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TvRenderTargets.GetInfo:TVkRenderPassBeginInfo;
|
Function TvRenderTargets.GetRInfo:TVkRenderPassBeginInfo;
|
||||||
begin
|
begin
|
||||||
Result:=Default(TVkRenderPassBeginInfo);
|
Result:=Default(TVkRenderPassBeginInfo);
|
||||||
Result.sType :=VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
|
Result.sType :=VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
|
||||||
|
@ -635,7 +635,7 @@ begin
|
||||||
Result.framebuffer :=FFramebuffer.FHandle;
|
Result.framebuffer :=FFramebuffer.FHandle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TvRenderTargets.GetInfo2:TVkRenderPassAttachmentBeginInfo;
|
Function TvRenderTargets.GetAInfo:TVkRenderPassAttachmentBeginInfo;
|
||||||
begin
|
begin
|
||||||
Result:=Default(TVkRenderPassAttachmentBeginInfo);
|
Result:=Default(TVkRenderPassAttachmentBeginInfo);
|
||||||
Result.sType :=VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO;
|
Result.sType :=VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO;
|
||||||
|
@ -652,7 +652,7 @@ Destructor TvRenderTargets.Destroy;
|
||||||
begin
|
begin
|
||||||
/////FreeAndNil(FRenderPass);
|
/////FreeAndNil(FRenderPass);
|
||||||
/////FreeAndNil(FPipeline);
|
/////FreeAndNil(FPipeline);
|
||||||
FreeAndNil(FFramebuffer);
|
//FreeAndNil(FFramebuffer);
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ begin
|
||||||
FreeAndNil(t);
|
FreeAndNil(t);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
t.Acquire;
|
t.Acquire; //map ref
|
||||||
FRenderPass2Set.Insert(@t.key);
|
FRenderPass2Set.Insert(@t.key);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue