From baa7ff47d548cdcc1ea68657ee1b0500f78041be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 10 Jul 2009 13:07:16 -0600 Subject: tgis: implement indirect addressing for destination registers Includes the TGSI interpreter, but not the SSE/PPC/etc code generators. --- src/gallium/auxiliary/tgsi/tgsi_build.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/gallium/auxiliary/tgsi/tgsi_build.c') diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index a1891a140a..18c448a2c7 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -584,6 +584,7 @@ tgsi_build_full_instruction( *dst_register = tgsi_build_dst_register( reg->DstRegister.File, reg->DstRegister.WriteMask, + reg->DstRegister.Indirect, reg->DstRegister.Index, instruction, header ); @@ -631,6 +632,28 @@ tgsi_build_full_instruction( header ); prev_token = (struct tgsi_token *) dst_register_ext_modulate; } + + if( reg->DstRegister.Indirect ) { + struct tgsi_src_register *ind; + + if( maxsize <= size ) + return 0; + ind = (struct tgsi_src_register *) &tokens[size]; + size++; + + *ind = tgsi_build_src_register( + reg->DstRegisterInd.File, + reg->DstRegisterInd.SwizzleX, + reg->DstRegisterInd.SwizzleY, + reg->DstRegisterInd.SwizzleZ, + reg->DstRegisterInd.SwizzleW, + reg->DstRegisterInd.Negate, + reg->DstRegisterInd.Indirect, + reg->DstRegisterInd.Dimension, + reg->DstRegisterInd.Index, + instruction, + header ); + } } for( i = 0; i < full_inst->Instruction.NumSrcRegs; i++ ) { @@ -1194,6 +1217,7 @@ struct tgsi_dst_register tgsi_build_dst_register( unsigned file, unsigned mask, + unsigned indirect, int index, struct tgsi_instruction *instruction, struct tgsi_header *header ) @@ -1208,6 +1232,7 @@ tgsi_build_dst_register( dst_register.File = file; dst_register.WriteMask = mask; dst_register.Index = index; + dst_register.Indirect = indirect; instruction_grow( instruction, header ); @@ -1220,6 +1245,7 @@ tgsi_default_full_dst_register( void ) struct tgsi_full_dst_register full_dst_register; full_dst_register.DstRegister = tgsi_default_dst_register(); + full_dst_register.DstRegisterInd = tgsi_default_src_register(); full_dst_register.DstRegisterExtConcode = tgsi_default_dst_register_ext_concode(); full_dst_register.DstRegisterExtModulate = -- cgit v1.2.3