mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
9da60ed0ca
commit
6e528805c7
|
@ -706,7 +706,15 @@ procedure onEventWriteEos(pm4Hdr:PM4_TYPE_3_HEADER;Body:PTPM4CMDEVENTWRITEEOS);
|
|||
var
|
||||
adr:PDWORD;
|
||||
begin
|
||||
Assert(Body^.eventType=47);
|
||||
|
||||
{$ifdef ww}
|
||||
Case Body^.eventType of
|
||||
CS_DONE:Writeln(' CS_DONE');
|
||||
PS_DONE:Writeln(' PS_DONE');
|
||||
else
|
||||
Assert(False,IntToStr(Body^.eventType));
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
Case Body^.eventIndex of
|
||||
EVENT_WRITE_EOS_INDEX_CSDONE_PSDONE:
|
||||
|
|
|
@ -1180,6 +1180,18 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function ps4_sceGnmResetVgtControl(cmdBuffer:PDWORD;param:Integer):Integer; SysV_ABI_CDecl;
|
||||
begin
|
||||
Result:=-1;
|
||||
if (cmdBuffer<>nil) and (param=3) then
|
||||
begin
|
||||
Result:=0;
|
||||
cmdBuffer[0]:=$c0016900;
|
||||
cmdBuffer[1]:=$2aa;
|
||||
cmdBuffer[2]:=$ff;
|
||||
end;
|
||||
end;
|
||||
|
||||
function ps4_sceGnmDispatchDirect(cmdBuffer:PDWORD;numDwords:DWORD;
|
||||
threadGroupX,
|
||||
threadGroupY,
|
||||
|
@ -1484,6 +1496,7 @@ begin
|
|||
lib^.set_proc($98B54BECDEC15418,@ps4_sceGnmUpdatePsShader350);
|
||||
|
||||
lib^.set_proc($7050A9D0D5FCC1FD,@ps4_sceGnmSetVgtControl);
|
||||
lib^.set_proc($31846D621A2329D0,@ps4_sceGnmResetVgtControl);
|
||||
|
||||
lib^.set_proc($D01CCB1A58DCC01A,@ps4_sceGnmDispatchDirect);
|
||||
|
||||
|
|
|
@ -1217,9 +1217,21 @@ begin
|
|||
|
||||
if (ENA.ANCILLARY_ENA<>0) then
|
||||
begin
|
||||
AddInput(@FRegsStory.VGRP[p],dtUint32,itAncillary);
|
||||
SetConst(@FRegsStory.VGRP[p],dtUint32,2);
|
||||
//AddInput(@FRegsStory.VGRP[p],dtUint32,itAncillary);
|
||||
p:=p+1;
|
||||
//Render target array index[26:16], Iterated sample number[11:8], Primitive type[1:0]
|
||||
//Render target array index[26:16], BuiltIn.Layer
|
||||
//Iterated sample number[11:8], BuiltIn.SampleId
|
||||
//Primitive type[1:0] 0..3
|
||||
|
||||
//POINT 00
|
||||
//LINE 01
|
||||
//TRI 10
|
||||
//RECT 11
|
||||
|
||||
//PID ISID RTAI
|
||||
//01|234567|89AB|CDEF|0123456789A|
|
||||
//10|000000| |0000|00000000000|
|
||||
end;
|
||||
|
||||
if (ENA.SAMPLE_COVERAGE_ENA<>0) then
|
||||
|
|
|
@ -75,7 +75,7 @@ begin
|
|||
FInputs .AllocBinding(@FDecorates);
|
||||
FOutputs .AllocBinding(@FDecorates);
|
||||
FVertLayouts.AllocBinding(@FDecorates);
|
||||
FFragLayouts.AllocBinding(@FDecorates);
|
||||
FFragLayouts.AllocBinding(@FDecorates,@FSpirvCaps);
|
||||
|
||||
FBinding:=0;
|
||||
FUniforms.AllocBinding(FBinding,@FDecorates);
|
||||
|
|
|
@ -41,6 +41,7 @@ type
|
|||
procedure _emit_V_MAC_F32;
|
||||
|
||||
procedure _emit_V_BFE_U32;
|
||||
procedure _emit_V_BFI_B32;
|
||||
procedure _emit_V_MAD_F32;
|
||||
procedure _emit_V_MAD_I32_I24;
|
||||
procedure _emit_V_MAD_U32_U24;
|
||||
|
@ -438,6 +439,36 @@ begin
|
|||
emit_OpBfeU(dst,src[0],offset,count);
|
||||
end;
|
||||
|
||||
procedure TEmit_VOP3._emit_V_BFI_B32;
|
||||
Var
|
||||
dst,tmp:PsrRegSlot;
|
||||
bitmsk:PsrRegNode;
|
||||
src:array[0..1] of PsrRegNode;
|
||||
begin
|
||||
dst:=FRegsStory.get_vdst8(FSPI.VOP3a.VDST);
|
||||
tmp:=@FRegsStory.FUnattach;
|
||||
|
||||
Assert(FSPI.VOP3a.OMOD =0,'FSPI.VOP3a.OMOD');
|
||||
Assert(FSPI.VOP3a.ABS =0,'FSPI.VOP3a.ABS');
|
||||
Assert(FSPI.VOP3a.CLAMP=0,'FSPI.VOP3a.CLAMP');
|
||||
Assert(FSPI.VOP3a.NEG =0,'FSPI.VOP3a.NEG');
|
||||
|
||||
bitmsk:=fetch_ssrc9(FSPI.VOP3a.SRC0,dtUint32);
|
||||
src[0]:=fetch_ssrc9(FSPI.VOP3a.SRC1,dtUint32);
|
||||
src[1]:=fetch_ssrc9(FSPI.VOP3a.SRC2,dtUint32);
|
||||
|
||||
emit_OpBitwiseAnd(tmp,src[0],bitmsk);
|
||||
src[0]:=MakeRead(tmp,dtUInt32);
|
||||
|
||||
emit_OpNot(tmp,bitmsk);
|
||||
bitmsk:=MakeRead(tmp,dtUInt32);
|
||||
|
||||
emit_OpBitwiseAnd(tmp,src[1],bitmsk);
|
||||
src[1]:=MakeRead(tmp,dtUInt32);
|
||||
|
||||
emit_OpBitwiseOr(dst,src[0],src[1]);
|
||||
end;
|
||||
|
||||
procedure TEmit_VOP3._emit_V_MAD_F32; //vdst = vsrc0.f * vsrc1.f + vadd.f
|
||||
Var
|
||||
dst:PsrRegSlot;
|
||||
|
@ -954,6 +985,11 @@ begin
|
|||
_emit_V_BFE_U32;
|
||||
end;
|
||||
|
||||
V_BFI_B32:
|
||||
begin
|
||||
_emit_V_BFI_B32;
|
||||
end;
|
||||
|
||||
V_MAD_F32:
|
||||
begin
|
||||
_emit_V_MAD_F32;
|
||||
|
|
|
@ -16,6 +16,7 @@ type
|
|||
function c(n1,n2:PSpirvCap):Integer; static;
|
||||
end;
|
||||
|
||||
PsrCapList=^TsrCapList;
|
||||
TsrCapList=object
|
||||
type
|
||||
TNodeFetch=specialize TNodeFetch<PSpirvCap,TSpirvCap>;
|
||||
|
|
|
@ -13,6 +13,7 @@ uses
|
|||
srLayout,
|
||||
srVariable,
|
||||
srInput,
|
||||
srCap,
|
||||
srDecorate;
|
||||
|
||||
type
|
||||
|
@ -45,7 +46,7 @@ type
|
|||
function Fetch(itype:TpsslInputType;location:DWORD):PsrFragLayout;
|
||||
Function First:PsrFragLayout;
|
||||
Function Next(node:PsrFragLayout):PsrFragLayout;
|
||||
procedure AllocBinding(Decorates:PsrDecorateList);
|
||||
procedure AllocBinding(Decorates:PsrDecorateList;Cap:PsrCapList);
|
||||
procedure AllocEntryPoint(EntryPoint:PSpirvOp);
|
||||
end;
|
||||
|
||||
|
@ -112,7 +113,7 @@ begin
|
|||
Result:=FNTree.Next(node);
|
||||
end;
|
||||
|
||||
procedure TsrFragLayoutList.AllocBinding(Decorates:PsrDecorateList);
|
||||
procedure TsrFragLayoutList.AllocBinding(Decorates:PsrDecorateList;Cap:PsrCapList);
|
||||
var
|
||||
node:PsrFragLayout;
|
||||
pVar:PsrVariable;
|
||||
|
@ -130,6 +131,7 @@ begin
|
|||
case node^.itype of
|
||||
itPerspSample: //Sample
|
||||
begin
|
||||
Cap^.Add(Capability.SampleRateShading);
|
||||
Decorates^.emit_decorate(ntVar,pVar,Decoration.Sample,0);
|
||||
end;
|
||||
itPerspCenter:; //default
|
||||
|
|
Loading…
Reference in New Issue