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_PUSH_MARKER =$68750001;
|
||||
OP_HINT_POP_MARKER =$68750002;
|
||||
OP_HINT_SET_MARKER =$68750003;
|
||||
OP_HINT_SET_VSHARP_IN_USER_DATA =$68750004;
|
||||
OP_HINT_SET_TSHARP_IN_USER_DATA =$68750005;
|
||||
OP_HINT_SET_SSHARP_IN_USER_DATA =$68750006;
|
||||
|
|
|
@ -959,6 +959,11 @@ begin
|
|||
{$ifdef ww}Writeln('\HINT_PUSH_MARKER:',Body);{$endif}
|
||||
end;
|
||||
|
||||
procedure onSetMarker(Body:PChar);
|
||||
begin
|
||||
{$ifdef ww}Writeln('\HINT_SET_MARKER:',Body);{$endif}
|
||||
end;
|
||||
|
||||
procedure onWidthHeight(Body:PWORD);
|
||||
begin
|
||||
{$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_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]);
|
||||
|
||||
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_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');
|
||||
|
@ -2209,6 +2218,7 @@ begin
|
|||
fdump_cs:=DumpCS(GPU_REGS);
|
||||
|
||||
GFXRing.AllocCmdBuffer;
|
||||
GFXRing.CmdBuffer.EndRenderPass;
|
||||
|
||||
FCSShader:=FetchShader(vShaderStageCs,0,GPU_REGS);
|
||||
if (FCSShader=nil) then Exit;
|
||||
|
|
|
@ -522,19 +522,21 @@ function ps4_sceGnmInsertPushMarker(cmdBuffer:PDWORD;numDwords:DWORD;param:PChar
|
|||
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;
|
||||
Assert(cmdSize+2=numDwords);
|
||||
if ((cmdSize+2)<>numDwords) then Exit(-1);
|
||||
|
||||
cmdBuffer[0]:=cmdSize*$10000 or $c0001000; //NOP
|
||||
cmdBuffer[1]:=$68750001;
|
||||
|
||||
len3:=len+1;
|
||||
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;
|
||||
end;
|
||||
|
@ -551,6 +553,29 @@ begin
|
|||
Result:=0;
|
||||
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
|
||||
function ps4_sceGnmInsertWaitFlipDone(cmdBuffer:PDWORD;numDwords:DWORD;videoOutHandle,displayBufferIndex:Integer):Integer; SysV_ABI_CDecl;
|
||||
var
|
||||
|
@ -1477,6 +1502,7 @@ begin
|
|||
|
||||
lib^.set_proc($5B512D8FF8E55BB6,@ps4_sceGnmInsertPushMarker);
|
||||
lib^.set_proc($EEA65536012EF926,@ps4_sceGnmInsertPopMarker);
|
||||
lib^.set_proc($8E222DCD2EBEDB68,@ps4_sceGnmInsertSetMarker);
|
||||
|
||||
lib^.set_proc($D6A5CB1C8A5138F1,@ps4_sceGnmInsertWaitFlipDone);
|
||||
lib^.set_proc($29796D9C2C042474,@ps4_sceGnmSetCsShader);
|
||||
|
|
|
@ -1210,7 +1210,7 @@ begin
|
|||
|
||||
if (ENA.FRONT_FACE_ENA<>0) then
|
||||
begin
|
||||
AddInput(@FRegsStory.VGRP[p],dtUint32,itFrontFace);
|
||||
AddInput(@FRegsStory.VGRP[p],dtBool,itFrontFace);
|
||||
p:=p+1;
|
||||
end;
|
||||
|
||||
|
|
|
@ -1480,6 +1480,15 @@ var
|
|||
Inc(Result);
|
||||
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
|
||||
Result:=0;
|
||||
dst:=node^.dst.AsReg;
|
||||
|
@ -1494,6 +1503,10 @@ begin
|
|||
data:=F_WQM_32(data);
|
||||
_SetConst(dst^.dtype,data);
|
||||
end else
|
||||
if (src^.dtype=dtBool) then
|
||||
begin
|
||||
_SetReg(src);
|
||||
end else
|
||||
begin
|
||||
Assert(false,'TODO')
|
||||
end;
|
||||
|
|
|
@ -170,6 +170,10 @@ begin
|
|||
begin
|
||||
Decorates^.emit_decorate(ntVar,pVar,Decoration.BuiltIn,BuiltIn.VertexIndex);
|
||||
end;
|
||||
itFrontFace:
|
||||
begin
|
||||
Decorates^.emit_decorate(ntVar,pVar,Decoration.BuiltIn,BuiltIn.FrontFacing);
|
||||
end;
|
||||
else
|
||||
Assert(false,'AllocBinding');
|
||||
end;
|
||||
|
|
|
@ -189,14 +189,24 @@ end;
|
|||
Procedure _Copy_Linear(cmd:TvCustomCmdBuffer;buf:TvTempBuffer;image:TvImage2);
|
||||
var
|
||||
BufferImageCopy:TVkBufferImageCopy;
|
||||
extend:TvExtent3D;
|
||||
size:Ptruint;
|
||||
begin
|
||||
|
||||
cmd.AddDependence(@buf.Release);
|
||||
|
||||
size:=image.key.params.extend.width*
|
||||
image.key.params.extend.height*
|
||||
image.key.params.extend.depth*
|
||||
extend:=image.key.params.extend;
|
||||
|
||||
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);
|
||||
|
||||
image.PushBarrier(cmd,
|
||||
|
|
Loading…
Reference in New Issue