From d376fbbcb7d15ebf83ca7d71ae1555dbdbcb0bbf Mon Sep 17 00:00:00 2001 From: Pavel <68122101+red-prig@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:10:26 +0300 Subject: [PATCH] + --- spirv/srLayout.pas | 14 ++++++++++++++ vulkan/vShaderExt.pas | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/spirv/srLayout.pas b/spirv/srLayout.pas index 3a4723ee..396d7e95 100644 --- a/spirv/srLayout.pas +++ b/spirv/srLayout.pas @@ -6,6 +6,7 @@ interface uses sysutils, + si_ci_vi_merged_enum, ps4_shader, spirv, ginodes, @@ -883,6 +884,16 @@ begin //pList.OpSource(Space(deep+1)+name+':'+HexLen(P,len)); end; +function GetNumType(nfmt:Byte):Byte; inline; +begin + Case nfmt of + IMG_NUM_FORMAT_UINT:Result:=1; + IMG_NUM_FORMAT_SINT:Result:=2; + else + Result:=0; + end; +end; + procedure TsrDataLayoutList.AllocSourceExtension2; var Writer:TseWriter; @@ -950,6 +961,9 @@ begin Writer.IntOpt('DFMT',dfmt); Writer.IntOpt('NFMT',nfmt); Writer.StrOpt('DSEL',_get_dst_sel_str(dst_sel_x,dst_sel_y,dst_sel_z,dst_sel_w)); + end else + begin + Writer.IntOpt('NUMT',GetNumType(nfmt)); end; end; diff --git a/vulkan/vShaderExt.pas b/vulkan/vShaderExt.pas index cbdd2296..cd6aecf5 100644 --- a/vulkan/vShaderExt.pas +++ b/vulkan/vShaderExt.pas @@ -16,6 +16,7 @@ uses vImage, vSetLayoutManager, vPipelineLayoutManager, + si_ci_vi_merged_enum, si_ci_vi_merged_registers, si_ci_vi_merged_groups; @@ -771,6 +772,7 @@ begin 'RINF':L^.rinfo.enable:=(StrToDWord2(V)<>0); 'DFMT':L^.rinfo.dfmt :=StrToDWord2(V); 'NFMT':L^.rinfo.nfmt :=StrToDWord2(V); + 'NUMT':L^.rinfo.nfmt :=StrToDWord2(V); 'TYPE':L^.rinfo.rtype :=StrToDWord2(V); 'DSEL':L^.rinfo.dstsel :=StrToDstSel(V); @@ -1798,6 +1800,16 @@ begin end; end; +function GetNumType(nfmt:Byte):Byte; inline; +begin + Case nfmt of + IMG_NUM_FORMAT_UINT:Result:=1; + IMG_NUM_FORMAT_SINT:Result:=2; + else + Result:=0; + end; +end; + procedure TvUnifChecker.AddAttr(const b:TvCustomLayout;Fset:TVkUInt32;pUserData,pImmData:PDWORD); var P:Pointer; @@ -1847,8 +1859,8 @@ begin begin if rinfo.enable then - if (dfmt<>rinfo.dfmt) or - (nfmt<>rinfo.dfmt) or + if ( dfmt<>rinfo.dfmt ) or + ( nfmt<>rinfo.nfmt ) or (dst_sel_x<>rinfo.dstsel.x) or (dst_sel_y<>rinfo.dstsel.y) or (dst_sel_z<>rinfo.dstsel.z) or @@ -1871,15 +1883,24 @@ begin end; if rinfo.enable then - if (dfmt<>rinfo.dfmt) or - (nfmt<>rinfo.dfmt) or - (dst_sel_x<>rinfo.dstsel.x) or - (dst_sel_y<>rinfo.dstsel.y) or - (dst_sel_z<>rinfo.dstsel.z) or - (dst_sel_w<>rinfo.dstsel.w) then begin - FResult:=False; - Exit; + if ( dfmt<>rinfo.dfmt ) or + ( nfmt<>rinfo.nfmt ) or + (dst_sel_x<>rinfo.dstsel.x) or + (dst_sel_y<>rinfo.dstsel.y) or + (dst_sel_z<>rinfo.dstsel.z) or + (dst_sel_w<>rinfo.dstsel.w) then + begin + FResult:=False; + Exit; + end; + end else + begin + if (GetNumType(nfmt)<>GetNumType(rinfo.nfmt)) then + begin + FResult:=False; + Exit; + end; end; end;