mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
a39db791b9
commit
d143734fb7
|
@ -141,6 +141,7 @@ const
|
||||||
OP_HINT_BASE_ALLOCATE_FROM_COMMAND_BUFFER =$68750000;
|
OP_HINT_BASE_ALLOCATE_FROM_COMMAND_BUFFER =$68750000;
|
||||||
OP_HINT_PUSH_MARKER =$68750001;
|
OP_HINT_PUSH_MARKER =$68750001;
|
||||||
OP_HINT_POP_MARKER =$68750002;
|
OP_HINT_POP_MARKER =$68750002;
|
||||||
|
OP_HINT_SET_MARKER =$68750003;
|
||||||
OP_HINT_SET_VSHARP_IN_USER_DATA =$68750004;
|
OP_HINT_SET_VSHARP_IN_USER_DATA =$68750004;
|
||||||
OP_HINT_SET_TSHARP_IN_USER_DATA =$68750005;
|
OP_HINT_SET_TSHARP_IN_USER_DATA =$68750005;
|
||||||
OP_HINT_SET_SSHARP_IN_USER_DATA =$68750006;
|
OP_HINT_SET_SSHARP_IN_USER_DATA =$68750006;
|
||||||
|
|
|
@ -959,6 +959,11 @@ begin
|
||||||
{$ifdef ww}Writeln('\HINT_PUSH_MARKER:',Body);{$endif}
|
{$ifdef ww}Writeln('\HINT_PUSH_MARKER:',Body);{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure onSetMarker(Body:PChar);
|
||||||
|
begin
|
||||||
|
{$ifdef ww}Writeln('\HINT_SET_MARKER:',Body);{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
procedure onWidthHeight(Body:PWORD);
|
procedure onWidthHeight(Body:PWORD);
|
||||||
begin
|
begin
|
||||||
{$ifdef ww}Writeln('\HINT_',Body[0],'_',Body[1]);{$endif}
|
{$ifdef ww}Writeln('\HINT_',Body[0],'_',Body[1]);{$endif}
|
||||||
|
@ -1010,10 +1015,14 @@ begin
|
||||||
|
|
||||||
OP_HINT_WRITE_GPU_PREFETCH_INTO_L2 :Writeln('\HINT_WRITE_GPU_PREFETCH_INTO_L2');
|
OP_HINT_WRITE_GPU_PREFETCH_INTO_L2 :Writeln('\HINT_WRITE_GPU_PREFETCH_INTO_L2');
|
||||||
OP_HINT_BASE_ALLOCATE_FROM_COMMAND_BUFFER :Writeln('\HINT_BASE_ALLOCATE_FROM_COMMAND_BUFFER');
|
OP_HINT_BASE_ALLOCATE_FROM_COMMAND_BUFFER :Writeln('\HINT_BASE_ALLOCATE_FROM_COMMAND_BUFFER');
|
||||||
OP_HINT_PUSH_MARKER ://Writeln('\HINT_PUSH_MARKER');
|
OP_HINT_PUSH_MARKER :
|
||||||
onPushMarker(@Body[1]);
|
onPushMarker(@Body[1]);
|
||||||
|
|
||||||
OP_HINT_POP_MARKER :Writeln('\HINT_POP_MARKER');
|
OP_HINT_POP_MARKER :Writeln('\HINT_POP_MARKER');
|
||||||
|
|
||||||
|
OP_HINT_SET_MARKER:
|
||||||
|
onSetMarker(@Body[1]);
|
||||||
|
|
||||||
OP_HINT_SET_VSHARP_IN_USER_DATA :Writeln('\HINT_SET_VSHARP_IN_USER_DATA');
|
OP_HINT_SET_VSHARP_IN_USER_DATA :Writeln('\HINT_SET_VSHARP_IN_USER_DATA');
|
||||||
OP_HINT_SET_TSHARP_IN_USER_DATA :Writeln('\HINT_SET_TSHARP_IN_USER_DATA');
|
OP_HINT_SET_TSHARP_IN_USER_DATA :Writeln('\HINT_SET_TSHARP_IN_USER_DATA');
|
||||||
OP_HINT_SET_SSHARP_IN_USER_DATA :Writeln('\HINT_SET_SSHARP_IN_USER_DATA');
|
OP_HINT_SET_SSHARP_IN_USER_DATA :Writeln('\HINT_SET_SSHARP_IN_USER_DATA');
|
||||||
|
@ -2209,6 +2218,7 @@ begin
|
||||||
fdump_cs:=DumpCS(GPU_REGS);
|
fdump_cs:=DumpCS(GPU_REGS);
|
||||||
|
|
||||||
GFXRing.AllocCmdBuffer;
|
GFXRing.AllocCmdBuffer;
|
||||||
|
GFXRing.CmdBuffer.EndRenderPass;
|
||||||
|
|
||||||
FCSShader:=FetchShader(vShaderStageCs,0,GPU_REGS);
|
FCSShader:=FetchShader(vShaderStageCs,0,GPU_REGS);
|
||||||
if (FCSShader=nil) then Exit;
|
if (FCSShader=nil) then Exit;
|
||||||
|
|
|
@ -522,19 +522,21 @@ function ps4_sceGnmInsertPushMarker(cmdBuffer:PDWORD;numDwords:DWORD;param:PChar
|
||||||
var
|
var
|
||||||
cmdSize,len,len3,len4:DWORD;
|
cmdSize,len,len3,len4:DWORD;
|
||||||
begin
|
begin
|
||||||
|
if (cmdBuffer=nil) or (param=nil) then Exit(-1);
|
||||||
|
|
||||||
len:=StrLen(param);
|
len:=StrLen(param);
|
||||||
len3:=(len + $c) shr 3;
|
len3:=(len + $c) shr 3;
|
||||||
len4:=(len + $8) shr 2;
|
len4:=(len + $8) shr 2;
|
||||||
|
|
||||||
cmdSize:=len4+len3*2;
|
cmdSize:=len4+len3*2;
|
||||||
Assert(cmdSize+2=numDwords);
|
if ((cmdSize+2)<>numDwords) then Exit(-1);
|
||||||
|
|
||||||
cmdBuffer[0]:=cmdSize*$10000 or $c0001000; //NOP
|
cmdBuffer[0]:=cmdSize*$10000 or $c0001000; //NOP
|
||||||
cmdBuffer[1]:=$68750001;
|
cmdBuffer[1]:=$68750001;
|
||||||
|
|
||||||
len3:=len+1;
|
len3:=len+1;
|
||||||
Move(param^,cmdBuffer[2],len3);
|
Move(param^,cmdBuffer[2],len3);
|
||||||
FillChar(PByte(@cmdBuffer[2])[len3],numDwords*SizeOf(DWORD)-len3,0);
|
FillChar(PByte(@cmdBuffer[2])[len3],cmdSize*SizeOf(DWORD)-len3,0);
|
||||||
|
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
@ -551,6 +553,29 @@ begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function ps4_sceGnmInsertSetMarker(cmdBuffer:PDWORD;numDwords:DWORD;param:PChar):Integer; SysV_ABI_CDecl;
|
||||||
|
var
|
||||||
|
cmdSize,len,len3,len4:DWORD;
|
||||||
|
begin
|
||||||
|
if (cmdBuffer=nil) or (param=nil) then Exit(-1);
|
||||||
|
|
||||||
|
len:=StrLen(param);
|
||||||
|
len3:=(len + $c) shr 3;
|
||||||
|
len4:=(len + $8) shr 2;
|
||||||
|
|
||||||
|
cmdSize:=len4+len3*2;
|
||||||
|
if ((cmdSize+2)<>numDwords) then Exit(-1);
|
||||||
|
|
||||||
|
cmdBuffer[0]:=cmdSize*$10000 or $c0001000; //NOP
|
||||||
|
cmdBuffer[1]:=$68750003;
|
||||||
|
|
||||||
|
len3:=len+1;
|
||||||
|
Move(param^,cmdBuffer[2],len3);
|
||||||
|
FillChar(PByte(@cmdBuffer[2])[len3],cmdSize*SizeOf(DWORD)-len3,0);
|
||||||
|
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
// called in waitUntilSafeForRendering
|
// called in waitUntilSafeForRendering
|
||||||
function ps4_sceGnmInsertWaitFlipDone(cmdBuffer:PDWORD;numDwords:DWORD;videoOutHandle,displayBufferIndex:Integer):Integer; SysV_ABI_CDecl;
|
function ps4_sceGnmInsertWaitFlipDone(cmdBuffer:PDWORD;numDwords:DWORD;videoOutHandle,displayBufferIndex:Integer):Integer; SysV_ABI_CDecl;
|
||||||
var
|
var
|
||||||
|
@ -1477,6 +1502,7 @@ begin
|
||||||
|
|
||||||
lib^.set_proc($5B512D8FF8E55BB6,@ps4_sceGnmInsertPushMarker);
|
lib^.set_proc($5B512D8FF8E55BB6,@ps4_sceGnmInsertPushMarker);
|
||||||
lib^.set_proc($EEA65536012EF926,@ps4_sceGnmInsertPopMarker);
|
lib^.set_proc($EEA65536012EF926,@ps4_sceGnmInsertPopMarker);
|
||||||
|
lib^.set_proc($8E222DCD2EBEDB68,@ps4_sceGnmInsertSetMarker);
|
||||||
|
|
||||||
lib^.set_proc($D6A5CB1C8A5138F1,@ps4_sceGnmInsertWaitFlipDone);
|
lib^.set_proc($D6A5CB1C8A5138F1,@ps4_sceGnmInsertWaitFlipDone);
|
||||||
lib^.set_proc($29796D9C2C042474,@ps4_sceGnmSetCsShader);
|
lib^.set_proc($29796D9C2C042474,@ps4_sceGnmSetCsShader);
|
||||||
|
|
|
@ -1210,7 +1210,7 @@ begin
|
||||||
|
|
||||||
if (ENA.FRONT_FACE_ENA<>0) then
|
if (ENA.FRONT_FACE_ENA<>0) then
|
||||||
begin
|
begin
|
||||||
AddInput(@FRegsStory.VGRP[p],dtUint32,itFrontFace);
|
AddInput(@FRegsStory.VGRP[p],dtBool,itFrontFace);
|
||||||
p:=p+1;
|
p:=p+1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -1480,6 +1480,15 @@ var
|
||||||
Inc(Result);
|
Inc(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure _SetReg(src:PsrRegNode);
|
||||||
|
begin
|
||||||
|
src^.mark_read;
|
||||||
|
dst^.pWriter.SetParam(ntReg,src);
|
||||||
|
node^.OpId:=OpLinks; //mark remove
|
||||||
|
node^.dst:=Default(TOpParamSingle);
|
||||||
|
Inc(Result);
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
dst:=node^.dst.AsReg;
|
dst:=node^.dst.AsReg;
|
||||||
|
@ -1494,6 +1503,10 @@ begin
|
||||||
data:=F_WQM_32(data);
|
data:=F_WQM_32(data);
|
||||||
_SetConst(dst^.dtype,data);
|
_SetConst(dst^.dtype,data);
|
||||||
end else
|
end else
|
||||||
|
if (src^.dtype=dtBool) then
|
||||||
|
begin
|
||||||
|
_SetReg(src);
|
||||||
|
end else
|
||||||
begin
|
begin
|
||||||
Assert(false,'TODO')
|
Assert(false,'TODO')
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -170,6 +170,10 @@ begin
|
||||||
begin
|
begin
|
||||||
Decorates^.emit_decorate(ntVar,pVar,Decoration.BuiltIn,BuiltIn.VertexIndex);
|
Decorates^.emit_decorate(ntVar,pVar,Decoration.BuiltIn,BuiltIn.VertexIndex);
|
||||||
end;
|
end;
|
||||||
|
itFrontFace:
|
||||||
|
begin
|
||||||
|
Decorates^.emit_decorate(ntVar,pVar,Decoration.BuiltIn,BuiltIn.FrontFacing);
|
||||||
|
end;
|
||||||
else
|
else
|
||||||
Assert(false,'AllocBinding');
|
Assert(false,'AllocBinding');
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -189,14 +189,24 @@ end;
|
||||||
Procedure _Copy_Linear(cmd:TvCustomCmdBuffer;buf:TvTempBuffer;image:TvImage2);
|
Procedure _Copy_Linear(cmd:TvCustomCmdBuffer;buf:TvTempBuffer;image:TvImage2);
|
||||||
var
|
var
|
||||||
BufferImageCopy:TVkBufferImageCopy;
|
BufferImageCopy:TVkBufferImageCopy;
|
||||||
|
extend:TvExtent3D;
|
||||||
size:Ptruint;
|
size:Ptruint;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
cmd.AddDependence(@buf.Release);
|
cmd.AddDependence(@buf.Release);
|
||||||
|
|
||||||
size:=image.key.params.extend.width*
|
extend:=image.key.params.extend;
|
||||||
image.key.params.extend.height*
|
|
||||||
image.key.params.extend.depth*
|
if IsTexelFormat(image.key.cformat) then
|
||||||
|
begin
|
||||||
|
extend.width :=(extend.width +3) div 4;
|
||||||
|
extend.height :=(extend.height +3) div 4;
|
||||||
|
extend.depth :=(extend.depth +3) div 4;
|
||||||
|
end;
|
||||||
|
|
||||||
|
size:=extend.width*
|
||||||
|
extend.height*
|
||||||
|
extend.depth*
|
||||||
getFormatSize(image.key.cformat);
|
getFormatSize(image.key.cformat);
|
||||||
|
|
||||||
image.PushBarrier(cmd,
|
image.PushBarrier(cmd,
|
||||||
|
|
Loading…
Reference in New Issue