This commit is contained in:
Pavel 2022-07-01 17:39:05 +03:00 committed by red-prig
parent 9da60ed0ca
commit 6e528805c7
7 changed files with 78 additions and 6 deletions

View File

@ -706,7 +706,15 @@ procedure onEventWriteEos(pm4Hdr:PM4_TYPE_3_HEADER;Body:PTPM4CMDEVENTWRITEEOS);
var var
adr:PDWORD; adr:PDWORD;
begin 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 Case Body^.eventIndex of
EVENT_WRITE_EOS_INDEX_CSDONE_PSDONE: EVENT_WRITE_EOS_INDEX_CSDONE_PSDONE:

View File

@ -1180,6 +1180,18 @@ begin
end; end;
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; function ps4_sceGnmDispatchDirect(cmdBuffer:PDWORD;numDwords:DWORD;
threadGroupX, threadGroupX,
threadGroupY, threadGroupY,
@ -1484,6 +1496,7 @@ begin
lib^.set_proc($98B54BECDEC15418,@ps4_sceGnmUpdatePsShader350); lib^.set_proc($98B54BECDEC15418,@ps4_sceGnmUpdatePsShader350);
lib^.set_proc($7050A9D0D5FCC1FD,@ps4_sceGnmSetVgtControl); lib^.set_proc($7050A9D0D5FCC1FD,@ps4_sceGnmSetVgtControl);
lib^.set_proc($31846D621A2329D0,@ps4_sceGnmResetVgtControl);
lib^.set_proc($D01CCB1A58DCC01A,@ps4_sceGnmDispatchDirect); lib^.set_proc($D01CCB1A58DCC01A,@ps4_sceGnmDispatchDirect);

View File

@ -1217,9 +1217,21 @@ begin
if (ENA.ANCILLARY_ENA<>0) then if (ENA.ANCILLARY_ENA<>0) then
begin begin
AddInput(@FRegsStory.VGRP[p],dtUint32,itAncillary); SetConst(@FRegsStory.VGRP[p],dtUint32,2);
//AddInput(@FRegsStory.VGRP[p],dtUint32,itAncillary);
p:=p+1; 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; end;
if (ENA.SAMPLE_COVERAGE_ENA<>0) then if (ENA.SAMPLE_COVERAGE_ENA<>0) then

View File

@ -75,7 +75,7 @@ begin
FInputs .AllocBinding(@FDecorates); FInputs .AllocBinding(@FDecorates);
FOutputs .AllocBinding(@FDecorates); FOutputs .AllocBinding(@FDecorates);
FVertLayouts.AllocBinding(@FDecorates); FVertLayouts.AllocBinding(@FDecorates);
FFragLayouts.AllocBinding(@FDecorates); FFragLayouts.AllocBinding(@FDecorates,@FSpirvCaps);
FBinding:=0; FBinding:=0;
FUniforms.AllocBinding(FBinding,@FDecorates); FUniforms.AllocBinding(FBinding,@FDecorates);

View File

@ -41,6 +41,7 @@ type
procedure _emit_V_MAC_F32; procedure _emit_V_MAC_F32;
procedure _emit_V_BFE_U32; procedure _emit_V_BFE_U32;
procedure _emit_V_BFI_B32;
procedure _emit_V_MAD_F32; procedure _emit_V_MAD_F32;
procedure _emit_V_MAD_I32_I24; procedure _emit_V_MAD_I32_I24;
procedure _emit_V_MAD_U32_U24; procedure _emit_V_MAD_U32_U24;
@ -438,6 +439,36 @@ begin
emit_OpBfeU(dst,src[0],offset,count); emit_OpBfeU(dst,src[0],offset,count);
end; 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 procedure TEmit_VOP3._emit_V_MAD_F32; //vdst = vsrc0.f * vsrc1.f + vadd.f
Var Var
dst:PsrRegSlot; dst:PsrRegSlot;
@ -954,6 +985,11 @@ begin
_emit_V_BFE_U32; _emit_V_BFE_U32;
end; end;
V_BFI_B32:
begin
_emit_V_BFI_B32;
end;
V_MAD_F32: V_MAD_F32:
begin begin
_emit_V_MAD_F32; _emit_V_MAD_F32;

View File

@ -16,6 +16,7 @@ type
function c(n1,n2:PSpirvCap):Integer; static; function c(n1,n2:PSpirvCap):Integer; static;
end; end;
PsrCapList=^TsrCapList;
TsrCapList=object TsrCapList=object
type type
TNodeFetch=specialize TNodeFetch<PSpirvCap,TSpirvCap>; TNodeFetch=specialize TNodeFetch<PSpirvCap,TSpirvCap>;

View File

@ -13,6 +13,7 @@ uses
srLayout, srLayout,
srVariable, srVariable,
srInput, srInput,
srCap,
srDecorate; srDecorate;
type type
@ -45,7 +46,7 @@ type
function Fetch(itype:TpsslInputType;location:DWORD):PsrFragLayout; function Fetch(itype:TpsslInputType;location:DWORD):PsrFragLayout;
Function First:PsrFragLayout; Function First:PsrFragLayout;
Function Next(node:PsrFragLayout):PsrFragLayout; Function Next(node:PsrFragLayout):PsrFragLayout;
procedure AllocBinding(Decorates:PsrDecorateList); procedure AllocBinding(Decorates:PsrDecorateList;Cap:PsrCapList);
procedure AllocEntryPoint(EntryPoint:PSpirvOp); procedure AllocEntryPoint(EntryPoint:PSpirvOp);
end; end;
@ -112,7 +113,7 @@ begin
Result:=FNTree.Next(node); Result:=FNTree.Next(node);
end; end;
procedure TsrFragLayoutList.AllocBinding(Decorates:PsrDecorateList); procedure TsrFragLayoutList.AllocBinding(Decorates:PsrDecorateList;Cap:PsrCapList);
var var
node:PsrFragLayout; node:PsrFragLayout;
pVar:PsrVariable; pVar:PsrVariable;
@ -130,6 +131,7 @@ begin
case node^.itype of case node^.itype of
itPerspSample: //Sample itPerspSample: //Sample
begin begin
Cap^.Add(Capability.SampleRateShading);
Decorates^.emit_decorate(ntVar,pVar,Decoration.Sample,0); Decorates^.emit_decorate(ntVar,pVar,Decoration.Sample,0);
end; end;
itPerspCenter:; //default itPerspCenter:; //default