1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #include "util/u_debug.h"
29 #include "pipe/p_shader_tokens.h"
30 #include "tgsi_build.h"
31 #include "tgsi_parse.h"
39 tgsi_build_header( void )
41 struct tgsi_header header
;
43 header
.HeaderSize
= 1;
50 header_headersize_grow( struct tgsi_header
*header
)
52 assert( header
->HeaderSize
< 0xFF );
53 assert( header
->BodySize
== 0 );
59 header_bodysize_grow( struct tgsi_header
*header
)
61 assert( header
->BodySize
< 0xFFFFFF );
67 tgsi_default_processor( void )
69 struct tgsi_processor processor
;
71 processor
.Processor
= TGSI_PROCESSOR_FRAGMENT
;
72 processor
.Padding
= 0;
80 struct tgsi_header
*header
)
82 struct tgsi_processor processor
;
84 processor
= tgsi_default_processor();
85 processor
.Processor
= type
;
87 header_headersize_grow( header
);
96 struct tgsi_declaration
97 tgsi_default_declaration( void )
99 struct tgsi_declaration declaration
;
101 declaration
.Type
= TGSI_TOKEN_TYPE_DECLARATION
;
102 declaration
.NrTokens
= 1;
103 declaration
.File
= TGSI_FILE_NULL
;
104 declaration
.UsageMask
= TGSI_WRITEMASK_XYZW
;
105 declaration
.Interpolate
= TGSI_INTERPOLATE_CONSTANT
;
106 declaration
.Semantic
= 0;
107 declaration
.Centroid
= 0;
108 declaration
.Invariant
= 0;
109 declaration
.Padding
= 0;
114 struct tgsi_declaration
115 tgsi_build_declaration(
118 unsigned interpolate
,
122 struct tgsi_header
*header
)
124 struct tgsi_declaration declaration
;
126 assert( file
< TGSI_FILE_COUNT
);
127 assert( interpolate
< TGSI_INTERPOLATE_COUNT
);
129 declaration
= tgsi_default_declaration();
130 declaration
.File
= file
;
131 declaration
.UsageMask
= usage_mask
;
132 declaration
.Interpolate
= interpolate
;
133 declaration
.Semantic
= semantic
;
134 declaration
.Centroid
= centroid
;
135 declaration
.Invariant
= invariant
;
137 header_bodysize_grow( header
);
144 struct tgsi_declaration
*declaration
,
145 struct tgsi_header
*header
)
147 assert( declaration
->NrTokens
< 0xFF );
149 declaration
->NrTokens
++;
151 header_bodysize_grow( header
);
154 struct tgsi_full_declaration
155 tgsi_default_full_declaration( void )
157 struct tgsi_full_declaration full_declaration
;
159 full_declaration
.Declaration
= tgsi_default_declaration();
160 full_declaration
.Range
= tgsi_default_declaration_range();
161 full_declaration
.Semantic
= tgsi_default_declaration_semantic();
163 return full_declaration
;
167 tgsi_build_full_declaration(
168 const struct tgsi_full_declaration
*full_decl
,
169 struct tgsi_token
*tokens
,
170 struct tgsi_header
*header
,
174 struct tgsi_declaration
*declaration
;
175 struct tgsi_declaration_range
*dr
;
177 if( maxsize
<= size
)
179 declaration
= (struct tgsi_declaration
*) &tokens
[size
];
182 *declaration
= tgsi_build_declaration(
183 full_decl
->Declaration
.File
,
184 full_decl
->Declaration
.UsageMask
,
185 full_decl
->Declaration
.Interpolate
,
186 full_decl
->Declaration
.Semantic
,
187 full_decl
->Declaration
.Centroid
,
188 full_decl
->Declaration
.Invariant
,
193 dr
= (struct tgsi_declaration_range
*) &tokens
[size
];
196 *dr
= tgsi_build_declaration_range(
197 full_decl
->Range
.First
,
198 full_decl
->Range
.Last
,
202 if( full_decl
->Declaration
.Semantic
) {
203 struct tgsi_declaration_semantic
*ds
;
205 if( maxsize
<= size
)
207 ds
= (struct tgsi_declaration_semantic
*) &tokens
[size
];
210 *ds
= tgsi_build_declaration_semantic(
211 full_decl
->Semantic
.Name
,
212 full_decl
->Semantic
.Index
,
220 struct tgsi_declaration_range
221 tgsi_default_declaration_range( void )
223 struct tgsi_declaration_range dr
;
231 struct tgsi_declaration_range
232 tgsi_build_declaration_range(
235 struct tgsi_declaration
*declaration
,
236 struct tgsi_header
*header
)
238 struct tgsi_declaration_range declaration_range
;
240 assert( last
>= first
);
241 assert( last
<= 0xFFFF );
243 declaration_range
= tgsi_default_declaration_range();
244 declaration_range
.First
= first
;
245 declaration_range
.Last
= last
;
247 declaration_grow( declaration
, header
);
249 return declaration_range
;
252 struct tgsi_declaration_semantic
253 tgsi_default_declaration_semantic( void )
255 struct tgsi_declaration_semantic ds
;
257 ds
.Name
= TGSI_SEMANTIC_POSITION
;
264 struct tgsi_declaration_semantic
265 tgsi_build_declaration_semantic(
266 unsigned semantic_name
,
267 unsigned semantic_index
,
268 struct tgsi_declaration
*declaration
,
269 struct tgsi_header
*header
)
271 struct tgsi_declaration_semantic ds
;
273 assert( semantic_name
<= TGSI_SEMANTIC_COUNT
);
274 assert( semantic_index
<= 0xFFFF );
276 ds
= tgsi_default_declaration_semantic();
277 ds
.Name
= semantic_name
;
278 ds
.Index
= semantic_index
;
280 declaration_grow( declaration
, header
);
289 struct tgsi_immediate
290 tgsi_default_immediate( void )
292 struct tgsi_immediate immediate
;
294 immediate
.Type
= TGSI_TOKEN_TYPE_IMMEDIATE
;
295 immediate
.NrTokens
= 1;
296 immediate
.DataType
= TGSI_IMM_FLOAT32
;
297 immediate
.Padding
= 0;
302 struct tgsi_immediate
303 tgsi_build_immediate(
304 struct tgsi_header
*header
)
306 struct tgsi_immediate immediate
;
308 immediate
= tgsi_default_immediate();
310 header_bodysize_grow( header
);
315 struct tgsi_full_immediate
316 tgsi_default_full_immediate( void )
318 struct tgsi_full_immediate fullimm
;
320 fullimm
.Immediate
= tgsi_default_immediate();
321 fullimm
.u
[0].Float
= 0.0f
;
322 fullimm
.u
[1].Float
= 0.0f
;
323 fullimm
.u
[2].Float
= 0.0f
;
324 fullimm
.u
[3].Float
= 0.0f
;
331 struct tgsi_immediate
*immediate
,
332 struct tgsi_header
*header
)
334 assert( immediate
->NrTokens
< 0xFF );
336 immediate
->NrTokens
++;
338 header_bodysize_grow( header
);
341 union tgsi_immediate_data
342 tgsi_build_immediate_float32(
344 struct tgsi_immediate
*immediate
,
345 struct tgsi_header
*header
)
347 union tgsi_immediate_data immediate_data
;
349 immediate_data
.Float
= value
;
351 immediate_grow( immediate
, header
);
353 return immediate_data
;
357 tgsi_build_full_immediate(
358 const struct tgsi_full_immediate
*full_imm
,
359 struct tgsi_token
*tokens
,
360 struct tgsi_header
*header
,
363 unsigned size
= 0, i
;
364 struct tgsi_immediate
*immediate
;
366 if( maxsize
<= size
)
368 immediate
= (struct tgsi_immediate
*) &tokens
[size
];
371 *immediate
= tgsi_build_immediate( header
);
373 assert( full_imm
->Immediate
.NrTokens
<= 4 + 1 );
375 for( i
= 0; i
< full_imm
->Immediate
.NrTokens
- 1; i
++ ) {
376 union tgsi_immediate_data
*data
;
378 if( maxsize
<= size
)
380 data
= (union tgsi_immediate_data
*) &tokens
[size
];
383 *data
= tgsi_build_immediate_float32(
384 full_imm
->u
[i
].Float
,
396 struct tgsi_instruction
397 tgsi_default_instruction( void )
399 struct tgsi_instruction instruction
;
401 instruction
.Type
= TGSI_TOKEN_TYPE_INSTRUCTION
;
402 instruction
.NrTokens
= 1;
403 instruction
.Opcode
= TGSI_OPCODE_MOV
;
404 instruction
.Saturate
= TGSI_SAT_NONE
;
405 instruction
.Predicate
= 0;
406 instruction
.NumDstRegs
= 1;
407 instruction
.NumSrcRegs
= 1;
408 instruction
.Label
= 0;
409 instruction
.Texture
= 0;
410 instruction
.Padding
= 0;
415 struct tgsi_instruction
416 tgsi_build_instruction(unsigned opcode
,
419 unsigned num_dst_regs
,
420 unsigned num_src_regs
,
421 struct tgsi_header
*header
)
423 struct tgsi_instruction instruction
;
425 assert (opcode
<= TGSI_OPCODE_LAST
);
426 assert (saturate
<= TGSI_SAT_MINUS_PLUS_ONE
);
427 assert (num_dst_regs
<= 3);
428 assert (num_src_regs
<= 15);
430 instruction
= tgsi_default_instruction();
431 instruction
.Opcode
= opcode
;
432 instruction
.Saturate
= saturate
;
433 instruction
.Predicate
= predicate
;
434 instruction
.NumDstRegs
= num_dst_regs
;
435 instruction
.NumSrcRegs
= num_src_regs
;
437 header_bodysize_grow( header
);
444 struct tgsi_instruction
*instruction
,
445 struct tgsi_header
*header
)
447 assert (instruction
->NrTokens
< 0xFF);
449 instruction
->NrTokens
++;
451 header_bodysize_grow( header
);
454 struct tgsi_full_instruction
455 tgsi_default_full_instruction( void )
457 struct tgsi_full_instruction full_instruction
;
460 full_instruction
.Instruction
= tgsi_default_instruction();
461 full_instruction
.Predicate
= tgsi_default_instruction_predicate();
462 full_instruction
.Label
= tgsi_default_instruction_label();
463 full_instruction
.Texture
= tgsi_default_instruction_texture();
464 for( i
= 0; i
< TGSI_FULL_MAX_DST_REGISTERS
; i
++ ) {
465 full_instruction
.Dst
[i
] = tgsi_default_full_dst_register();
467 for( i
= 0; i
< TGSI_FULL_MAX_SRC_REGISTERS
; i
++ ) {
468 full_instruction
.Src
[i
] = tgsi_default_full_src_register();
471 return full_instruction
;
475 tgsi_build_full_instruction(
476 const struct tgsi_full_instruction
*full_inst
,
477 struct tgsi_token
*tokens
,
478 struct tgsi_header
*header
,
483 struct tgsi_instruction
*instruction
;
484 struct tgsi_token
*prev_token
;
486 if( maxsize
<= size
)
488 instruction
= (struct tgsi_instruction
*) &tokens
[size
];
491 *instruction
= tgsi_build_instruction(full_inst
->Instruction
.Opcode
,
492 full_inst
->Instruction
.Saturate
,
493 full_inst
->Instruction
.Predicate
,
494 full_inst
->Instruction
.NumDstRegs
,
495 full_inst
->Instruction
.NumSrcRegs
,
497 prev_token
= (struct tgsi_token
*) instruction
;
499 if (full_inst
->Instruction
.Predicate
) {
500 struct tgsi_instruction_predicate
*instruction_predicate
;
502 if (maxsize
<= size
) {
505 instruction_predicate
= (struct tgsi_instruction_predicate
*)&tokens
[size
];
508 *instruction_predicate
=
509 tgsi_build_instruction_predicate(full_inst
->Predicate
.Index
,
510 full_inst
->Predicate
.Negate
,
511 full_inst
->Predicate
.SwizzleX
,
512 full_inst
->Predicate
.SwizzleY
,
513 full_inst
->Predicate
.SwizzleZ
,
514 full_inst
->Predicate
.SwizzleW
,
519 if (full_inst
->Instruction
.Label
) {
520 struct tgsi_instruction_label
*instruction_label
;
522 if( maxsize
<= size
)
525 (struct tgsi_instruction_label
*) &tokens
[size
];
528 *instruction_label
= tgsi_build_instruction_label(
529 full_inst
->Label
.Label
,
533 prev_token
= (struct tgsi_token
*) instruction_label
;
536 if (full_inst
->Instruction
.Texture
) {
537 struct tgsi_instruction_texture
*instruction_texture
;
539 if( maxsize
<= size
)
541 instruction_texture
=
542 (struct tgsi_instruction_texture
*) &tokens
[size
];
545 *instruction_texture
= tgsi_build_instruction_texture(
546 full_inst
->Texture
.Texture
,
550 prev_token
= (struct tgsi_token
*) instruction_texture
;
553 for( i
= 0; i
< full_inst
->Instruction
.NumDstRegs
; i
++ ) {
554 const struct tgsi_full_dst_register
*reg
= &full_inst
->Dst
[i
];
555 struct tgsi_dst_register
*dst_register
;
556 struct tgsi_token
*prev_token
;
558 if( maxsize
<= size
)
560 dst_register
= (struct tgsi_dst_register
*) &tokens
[size
];
563 *dst_register
= tgsi_build_dst_register(
565 reg
->Register
.WriteMask
,
566 reg
->Register
.Indirect
,
570 prev_token
= (struct tgsi_token
*) dst_register
;
572 if( reg
->Register
.Indirect
) {
573 struct tgsi_src_register
*ind
;
575 if( maxsize
<= size
)
577 ind
= (struct tgsi_src_register
*) &tokens
[size
];
580 *ind
= tgsi_build_src_register(
582 reg
->Indirect
.SwizzleX
,
583 reg
->Indirect
.SwizzleY
,
584 reg
->Indirect
.SwizzleZ
,
585 reg
->Indirect
.SwizzleW
,
586 reg
->Indirect
.Negate
,
587 reg
->Indirect
.Absolute
,
588 reg
->Indirect
.Indirect
,
589 reg
->Indirect
.Dimension
,
596 for( i
= 0; i
< full_inst
->Instruction
.NumSrcRegs
; i
++ ) {
597 const struct tgsi_full_src_register
*reg
= &full_inst
->Src
[i
];
598 struct tgsi_src_register
*src_register
;
599 struct tgsi_token
*prev_token
;
601 if( maxsize
<= size
)
603 src_register
= (struct tgsi_src_register
*) &tokens
[size
];
606 *src_register
= tgsi_build_src_register(
608 reg
->Register
.SwizzleX
,
609 reg
->Register
.SwizzleY
,
610 reg
->Register
.SwizzleZ
,
611 reg
->Register
.SwizzleW
,
612 reg
->Register
.Negate
,
613 reg
->Register
.Absolute
,
614 reg
->Register
.Indirect
,
615 reg
->Register
.Dimension
,
619 prev_token
= (struct tgsi_token
*) src_register
;
621 if( reg
->Register
.Indirect
) {
622 struct tgsi_src_register
*ind
;
624 if( maxsize
<= size
)
626 ind
= (struct tgsi_src_register
*) &tokens
[size
];
629 *ind
= tgsi_build_src_register(
631 reg
->Indirect
.SwizzleX
,
632 reg
->Indirect
.SwizzleY
,
633 reg
->Indirect
.SwizzleZ
,
634 reg
->Indirect
.SwizzleW
,
635 reg
->Indirect
.Negate
,
636 reg
->Indirect
.Absolute
,
637 reg
->Indirect
.Indirect
,
638 reg
->Indirect
.Dimension
,
644 if( reg
->Register
.Dimension
) {
645 struct tgsi_dimension
*dim
;
647 assert( !reg
->Dimension
.Dimension
);
649 if( maxsize
<= size
)
651 dim
= (struct tgsi_dimension
*) &tokens
[size
];
654 *dim
= tgsi_build_dimension(
655 reg
->Dimension
.Indirect
,
656 reg
->Dimension
.Index
,
660 if( reg
->Dimension
.Indirect
) {
661 struct tgsi_src_register
*ind
;
663 if( maxsize
<= size
)
665 ind
= (struct tgsi_src_register
*) &tokens
[size
];
668 *ind
= tgsi_build_src_register(
669 reg
->DimIndirect
.File
,
670 reg
->DimIndirect
.SwizzleX
,
671 reg
->DimIndirect
.SwizzleY
,
672 reg
->DimIndirect
.SwizzleZ
,
673 reg
->DimIndirect
.SwizzleW
,
674 reg
->DimIndirect
.Negate
,
675 reg
->DimIndirect
.Absolute
,
676 reg
->DimIndirect
.Indirect
,
677 reg
->DimIndirect
.Dimension
,
678 reg
->DimIndirect
.Index
,
688 struct tgsi_instruction_predicate
689 tgsi_default_instruction_predicate(void)
691 struct tgsi_instruction_predicate instruction_predicate
;
693 instruction_predicate
.SwizzleX
= TGSI_SWIZZLE_X
;
694 instruction_predicate
.SwizzleY
= TGSI_SWIZZLE_Y
;
695 instruction_predicate
.SwizzleZ
= TGSI_SWIZZLE_Z
;
696 instruction_predicate
.SwizzleW
= TGSI_SWIZZLE_W
;
697 instruction_predicate
.Negate
= 0;
698 instruction_predicate
.Index
= 0;
699 instruction_predicate
.Padding
= 0;
701 return instruction_predicate
;
704 struct tgsi_instruction_predicate
705 tgsi_build_instruction_predicate(int index
,
711 struct tgsi_instruction
*instruction
,
712 struct tgsi_header
*header
)
714 struct tgsi_instruction_predicate instruction_predicate
;
716 instruction_predicate
= tgsi_default_instruction_predicate();
717 instruction_predicate
.SwizzleX
= swizzleX
;
718 instruction_predicate
.SwizzleY
= swizzleY
;
719 instruction_predicate
.SwizzleZ
= swizzleZ
;
720 instruction_predicate
.SwizzleW
= swizzleW
;
721 instruction_predicate
.Negate
= negate
;
722 instruction_predicate
.Index
= index
;
724 instruction_grow(instruction
, header
);
726 return instruction_predicate
;
729 struct tgsi_instruction_label
730 tgsi_default_instruction_label( void )
732 struct tgsi_instruction_label instruction_label
;
734 instruction_label
.Label
= 0;
735 instruction_label
.Padding
= 0;
737 return instruction_label
;
740 struct tgsi_instruction_label
741 tgsi_build_instruction_label(
743 struct tgsi_token
*prev_token
,
744 struct tgsi_instruction
*instruction
,
745 struct tgsi_header
*header
)
747 struct tgsi_instruction_label instruction_label
;
749 instruction_label
= tgsi_default_instruction_label();
750 instruction_label
.Label
= label
;
751 instruction
->Label
= 1;
753 instruction_grow( instruction
, header
);
755 return instruction_label
;
758 struct tgsi_instruction_texture
759 tgsi_default_instruction_texture( void )
761 struct tgsi_instruction_texture instruction_texture
;
763 instruction_texture
.Texture
= TGSI_TEXTURE_UNKNOWN
;
764 instruction_texture
.Padding
= 0;
766 return instruction_texture
;
769 struct tgsi_instruction_texture
770 tgsi_build_instruction_texture(
772 struct tgsi_token
*prev_token
,
773 struct tgsi_instruction
*instruction
,
774 struct tgsi_header
*header
)
776 struct tgsi_instruction_texture instruction_texture
;
778 instruction_texture
= tgsi_default_instruction_texture();
779 instruction_texture
.Texture
= texture
;
780 instruction
->Texture
= 1;
782 instruction_grow( instruction
, header
);
784 return instruction_texture
;
787 struct tgsi_src_register
788 tgsi_default_src_register( void )
790 struct tgsi_src_register src_register
;
792 src_register
.File
= TGSI_FILE_NULL
;
793 src_register
.SwizzleX
= TGSI_SWIZZLE_X
;
794 src_register
.SwizzleY
= TGSI_SWIZZLE_Y
;
795 src_register
.SwizzleZ
= TGSI_SWIZZLE_Z
;
796 src_register
.SwizzleW
= TGSI_SWIZZLE_W
;
797 src_register
.Negate
= 0;
798 src_register
.Absolute
= 0;
799 src_register
.Indirect
= 0;
800 src_register
.Dimension
= 0;
801 src_register
.Index
= 0;
806 struct tgsi_src_register
807 tgsi_build_src_register(
818 struct tgsi_instruction
*instruction
,
819 struct tgsi_header
*header
)
821 struct tgsi_src_register src_register
;
823 assert( file
< TGSI_FILE_COUNT
);
824 assert( swizzle_x
<= TGSI_SWIZZLE_W
);
825 assert( swizzle_y
<= TGSI_SWIZZLE_W
);
826 assert( swizzle_z
<= TGSI_SWIZZLE_W
);
827 assert( swizzle_w
<= TGSI_SWIZZLE_W
);
828 assert( negate
<= 1 );
829 assert( index
>= -0x8000 && index
<= 0x7FFF );
831 src_register
= tgsi_default_src_register();
832 src_register
.File
= file
;
833 src_register
.SwizzleX
= swizzle_x
;
834 src_register
.SwizzleY
= swizzle_y
;
835 src_register
.SwizzleZ
= swizzle_z
;
836 src_register
.SwizzleW
= swizzle_w
;
837 src_register
.Negate
= negate
;
838 src_register
.Absolute
= absolute
;
839 src_register
.Indirect
= indirect
;
840 src_register
.Dimension
= dimension
;
841 src_register
.Index
= index
;
843 instruction_grow( instruction
, header
);
848 struct tgsi_full_src_register
849 tgsi_default_full_src_register( void )
851 struct tgsi_full_src_register full_src_register
;
853 full_src_register
.Register
= tgsi_default_src_register();
854 full_src_register
.Indirect
= tgsi_default_src_register();
855 full_src_register
.Dimension
= tgsi_default_dimension();
856 full_src_register
.DimIndirect
= tgsi_default_src_register();
858 return full_src_register
;
862 struct tgsi_dimension
863 tgsi_default_dimension( void )
865 struct tgsi_dimension dimension
;
867 dimension
.Indirect
= 0;
868 dimension
.Dimension
= 0;
869 dimension
.Padding
= 0;
875 struct tgsi_dimension
876 tgsi_build_dimension(
879 struct tgsi_instruction
*instruction
,
880 struct tgsi_header
*header
)
882 struct tgsi_dimension dimension
;
884 dimension
= tgsi_default_dimension();
885 dimension
.Indirect
= indirect
;
886 dimension
.Index
= index
;
888 instruction_grow( instruction
, header
);
893 struct tgsi_dst_register
894 tgsi_default_dst_register( void )
896 struct tgsi_dst_register dst_register
;
898 dst_register
.File
= TGSI_FILE_NULL
;
899 dst_register
.WriteMask
= TGSI_WRITEMASK_XYZW
;
900 dst_register
.Indirect
= 0;
901 dst_register
.Dimension
= 0;
902 dst_register
.Index
= 0;
903 dst_register
.Padding
= 0;
908 struct tgsi_dst_register
909 tgsi_build_dst_register(
914 struct tgsi_instruction
*instruction
,
915 struct tgsi_header
*header
)
917 struct tgsi_dst_register dst_register
;
919 assert( file
< TGSI_FILE_COUNT
);
920 assert( mask
<= TGSI_WRITEMASK_XYZW
);
921 assert( index
>= -32768 && index
<= 32767 );
923 dst_register
= tgsi_default_dst_register();
924 dst_register
.File
= file
;
925 dst_register
.WriteMask
= mask
;
926 dst_register
.Index
= index
;
927 dst_register
.Indirect
= indirect
;
929 instruction_grow( instruction
, header
);
934 struct tgsi_full_dst_register
935 tgsi_default_full_dst_register( void )
937 struct tgsi_full_dst_register full_dst_register
;
939 full_dst_register
.Register
= tgsi_default_dst_register();
940 full_dst_register
.Indirect
= tgsi_default_src_register();
942 return full_dst_register
;