fix OpExtract

This commit is contained in:
red-prig 2023-03-07 20:15:36 +03:00
parent ebfbe572e1
commit 76f2c3947f
3 changed files with 15 additions and 2 deletions

View File

@ -317,6 +317,7 @@ begin
src:=RegsStory.get_ssrc8(SOFFSET);
Result:=MakeRead(src,rtype);
end;
Assert(Result<>nil,'fetch_ssrc8');
end;
function TEmitFetch.fetch_ssrc9(SSRC:Word;rtype:TsrDataType):PsrRegNode;
@ -333,6 +334,7 @@ begin
src:=RegsStory.get_ssrc9(SSRC);
Result:=MakeRead(src,rtype);
end;
Assert(Result<>nil,'fetch_ssrc9');
end;
function TEmitFetch.fetch_ssrc9_pair(SSRC:Word;src:PPsrRegNode;rtype:TsrDataType):Boolean;
@ -361,6 +363,7 @@ var
begin
src:=RegsStory.get_vsrc8(VSRC);
Result:=MakeRead(src,rtype);
Assert(Result<>nil,'fetch_vsrc8');
end;
function TEmitFetch.fetch_vdst8(VDST:Word;rtype:TsrDataType):PsrRegNode;
@ -369,6 +372,7 @@ var
begin
src:=RegsStory.get_vdst8(VDST);
Result:=MakeRead(src,rtype);
Assert(Result<>nil,'fetch_vdst8');
end;
procedure TEmitFetch.fetch_vsrc8_vec2h(VSRC:Word;var dst0,dst1:PsrRegNode);
@ -379,6 +383,7 @@ begin
pSlot:=RegsStory.get_vsrc8(VSRC);
dst:=MakeRead(pSlot,dtVec2h);
Assert(dst<>nil,'fetch_vsrc8_vec2h');
dst0:=NewReg(dtHalf16);
dst1:=NewReg(dtHalf16);;

View File

@ -52,8 +52,15 @@ end;
procedure TEmit_MUBUF.make_load_comp(dst:PsrRegSlot;dtype:TsrDataType;rsl:PsrRegNode;i:Byte);
begin
dst^.New(line,dtype);
OpExtract(line,dst^.current,rsl,i);
if rsl^.dtype.isVector then
begin
dst^.New(line,dtype);
OpExtract(line,dst^.current,rsl,i);
end else
begin
Assert(i=0);
MakeCopy(dst,rsl);
end;
end;
function TEmit_MUBUF.emit_BUFFER_LOAD_VA(src:PPsrRegSlot;count:Byte):Boolean;

View File

@ -423,6 +423,7 @@ function TEmitOp.OpExtract(pLine:PspirvOp;dst,src:PsrRegNode;id:DWORD):PSpirvOp;
Var
node:PSpirvOp;
begin
Assert(src^.dtype.isVector);
node:=AddSpirvOp(pLine,Op.OpCompositeExtract);
node^.pType:=TypeList.Fetch(dst^.dtype);
node^.pDst:=dst;