unit emit_vbuf_load; {$mode ObjFPC}{$H+} interface uses sysutils, ps4_pssl, srType, srReg, srLayout, emit_fetch, srVBufInfo, emit_vbuf_chain; type Tload_cache=record info:TBuf_info; v:TvarChain; dst:PsrRegSlot; elem_orig:TsrDataType; elem_resl:TsrDataType; elem_count:ptruint; rsl:PsrRegNode; elm:array[0..3] of PsrRegNode; end; TEmit_vbuf_load=class(TEmitFetch) procedure buf_load(info:TBuf_info); function convert_e(var lc:Tload_cache;src:PsrRegNode):PsrRegNode; procedure make_load_cv_id(var lc:Tload_cache;i:Byte); procedure make_load_ce_id(var lc:Tload_cache;i:Byte); procedure make_load_uv_id(var lc:Tload_cache;i:Byte); procedure make_load_ue_id(var lc:Tload_cache;i:Byte); procedure make_load_zero(var lc:Tload_cache); procedure make_load_one(var lc:Tload_cache); procedure buf_load_cv(info:TBuf_info;v:TvarChain); end; implementation procedure TEmit_vbuf_load.buf_load(info:TBuf_info); var v:TvarChain; begin v:=TEmit_vbuf_chain(TObject(Self)).get_chain(info); if (v.vType=vcUniformVector) then begin //reset dst sel info.dsel:=dst_sel_identity; end; buf_load_cv(info,v); end; function TEmit_vbuf_load.convert_e(var lc:Tload_cache;src:PsrRegNode):PsrRegNode; begin Result:=src; if (lc.elem_resl<>lc.elem_orig) then Case lc.info.NFMT of BUF_NUM_FORMAT_UNORM : //Unsigned, normalized to range [0.0..1.0]; data/(1<