1 /**************************************************************************
3 * Copyright 2009 VMware, Inc.
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 VMWARE, INC 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 **************************************************************************/
31 #include "pipe/p_compiler.h"
32 #include "pipe/p_shader_tokens.h"
33 #include "util/u_debug.h"
41 /* Almost a tgsi_src_register, but we need to pull in the Absolute
42 * flag from the _ext token. Indirect flag always implies ADDR[0].
46 unsigned File
: 4; /* TGSI_FILE_ */
47 unsigned SwizzleX
: 2; /* TGSI_SWIZZLE_ */
48 unsigned SwizzleY
: 2; /* TGSI_SWIZZLE_ */
49 unsigned SwizzleZ
: 2; /* TGSI_SWIZZLE_ */
50 unsigned SwizzleW
: 2; /* TGSI_SWIZZLE_ */
51 unsigned Indirect
: 1; /* BOOL */
52 unsigned DimIndirect
: 1; /* BOOL */
53 unsigned Dimension
: 1; /* BOOL */
54 unsigned Absolute
: 1; /* BOOL */
55 unsigned Negate
: 1; /* BOOL */
56 unsigned IndirectFile
: 4; /* TGSI_FILE_ */
57 unsigned IndirectSwizzle
: 2; /* TGSI_SWIZZLE_ */
58 unsigned DimIndFile
: 4; /* TGSI_FILE_ */
59 unsigned DimIndSwizzle
: 2; /* TGSI_SWIZZLE_ */
60 int Index
: 16; /* SINT */
61 int IndirectIndex
: 16; /* SINT */
62 int DimensionIndex
: 16; /* SINT */
63 int DimIndIndex
: 16; /* SINT */
66 /* Very similar to a tgsi_dst_register, removing unsupported fields
67 * and adding a Saturate flag. It's easier to push saturate into the
68 * destination register than to try and create a _SAT variant of each
69 * instruction function.
73 unsigned File
: 4; /* TGSI_FILE_ */
74 unsigned WriteMask
: 4; /* TGSI_WRITEMASK_ */
75 unsigned Indirect
: 1; /* BOOL */
76 unsigned Saturate
: 1; /* BOOL */
77 unsigned Predicate
: 1;
78 unsigned PredNegate
: 1; /* BOOL */
79 unsigned PredSwizzleX
: 2; /* TGSI_SWIZZLE_ */
80 unsigned PredSwizzleY
: 2; /* TGSI_SWIZZLE_ */
81 unsigned PredSwizzleZ
: 2; /* TGSI_SWIZZLE_ */
82 unsigned PredSwizzleW
: 2; /* TGSI_SWIZZLE_ */
83 int Index
: 16; /* SINT */
84 int IndirectIndex
: 16; /* SINT */
85 int IndirectSwizzle
: 2; /* TGSI_SWIZZLE_ */
91 ureg_create( unsigned processor
);
93 const struct tgsi_token
*
94 ureg_finalize( struct ureg_program
* );
96 /* Create and return a shader:
99 ureg_create_shader( struct ureg_program
*,
100 struct pipe_context
*pipe
);
103 /* Alternately, return the built token stream and hand ownership of
104 * that memory to the caller:
106 const struct tgsi_token
*
107 ureg_get_tokens( struct ureg_program
*ureg
,
108 unsigned *nr_tokens
);
111 /* Free the tokens created by ureg_get_tokens() */
112 void ureg_free_tokens( const struct tgsi_token
*tokens
);
116 ureg_destroy( struct ureg_program
* );
119 /***********************************************************************
120 * Convenience routine:
123 ureg_create_shader_and_destroy( struct ureg_program
*p
,
124 struct pipe_context
*pipe
)
126 void *result
= ureg_create_shader( p
, pipe
);
132 /***********************************************************************
133 * Build shader properties:
137 ureg_property_gs_input_prim(struct ureg_program
*ureg
,
138 unsigned input_prim
);
141 ureg_property_gs_output_prim(struct ureg_program
*ureg
,
142 unsigned output_prim
);
145 ureg_property_gs_max_vertices(struct ureg_program
*ureg
,
146 unsigned max_vertices
);
149 ureg_property_fs_coord_origin(struct ureg_program
*ureg
,
150 unsigned fs_coord_origin
);
153 ureg_property_fs_coord_pixel_center(struct ureg_program
*ureg
,
154 unsigned fs_coord_pixel_center
);
157 ureg_property_fs_color0_writes_all_cbufs(struct ureg_program
*ureg
,
158 unsigned fs_color0_writes_all_cbufs
);
160 /***********************************************************************
161 * Build shader declarations:
165 ureg_DECL_fs_input_cyl_centroid(struct ureg_program
*,
166 unsigned semantic_name
,
167 unsigned semantic_index
,
168 unsigned interp_mode
,
169 unsigned cylindrical_wrap
,
172 static INLINE
struct ureg_src
173 ureg_DECL_fs_input_cyl(struct ureg_program
*ureg
,
174 unsigned semantic_name
,
175 unsigned semantic_index
,
176 unsigned interp_mode
,
177 unsigned cylindrical_wrap
)
179 return ureg_DECL_fs_input_cyl_centroid(ureg
,
187 static INLINE
struct ureg_src
188 ureg_DECL_fs_input(struct ureg_program
*ureg
,
189 unsigned semantic_name
,
190 unsigned semantic_index
,
191 unsigned interp_mode
)
193 return ureg_DECL_fs_input_cyl_centroid(ureg
,
201 ureg_DECL_vs_input( struct ureg_program
*,
205 ureg_DECL_gs_input(struct ureg_program
*,
207 unsigned semantic_name
,
208 unsigned semantic_index
);
211 ureg_DECL_system_value(struct ureg_program
*,
213 unsigned semantic_name
,
214 unsigned semantic_index
);
217 ureg_DECL_output( struct ureg_program
*,
218 unsigned semantic_name
,
219 unsigned semantic_index
);
222 ureg_DECL_immediate( struct ureg_program
*,
227 ureg_DECL_immediate_uint( struct ureg_program
*,
232 ureg_DECL_immediate_block_uint( struct ureg_program
*,
237 ureg_DECL_immediate_int( struct ureg_program
*,
242 ureg_DECL_constant2D(struct ureg_program
*ureg
,
248 ureg_DECL_constant( struct ureg_program
*,
252 ureg_DECL_temporary( struct ureg_program
* );
255 ureg_release_temporary( struct ureg_program
*ureg
,
256 struct ureg_dst tmp
);
259 ureg_DECL_address( struct ureg_program
* );
262 ureg_DECL_predicate(struct ureg_program
*);
264 /* Supply an index to the sampler declaration as this is the hook to
265 * the external pipe_sampler state. Users of this function probably
266 * don't want just any sampler, but a specific one which they've set
267 * up state for in the context.
270 ureg_DECL_sampler( struct ureg_program
*,
274 ureg_DECL_resource(struct ureg_program
*,
277 unsigned return_type_x
,
278 unsigned return_type_y
,
279 unsigned return_type_z
,
280 unsigned return_type_w
);
283 static INLINE
struct ureg_src
284 ureg_imm4f( struct ureg_program
*ureg
,
293 return ureg_DECL_immediate( ureg
, v
, 4 );
296 static INLINE
struct ureg_src
297 ureg_imm3f( struct ureg_program
*ureg
,
305 return ureg_DECL_immediate( ureg
, v
, 3 );
308 static INLINE
struct ureg_src
309 ureg_imm2f( struct ureg_program
*ureg
,
315 return ureg_DECL_immediate( ureg
, v
, 2 );
318 static INLINE
struct ureg_src
319 ureg_imm1f( struct ureg_program
*ureg
,
324 return ureg_DECL_immediate( ureg
, v
, 1 );
327 static INLINE
struct ureg_src
328 ureg_imm4u( struct ureg_program
*ureg
,
329 unsigned a
, unsigned b
,
330 unsigned c
, unsigned d
)
337 return ureg_DECL_immediate_uint( ureg
, v
, 4 );
340 static INLINE
struct ureg_src
341 ureg_imm3u( struct ureg_program
*ureg
,
342 unsigned a
, unsigned b
,
349 return ureg_DECL_immediate_uint( ureg
, v
, 3 );
352 static INLINE
struct ureg_src
353 ureg_imm2u( struct ureg_program
*ureg
,
354 unsigned a
, unsigned b
)
359 return ureg_DECL_immediate_uint( ureg
, v
, 2 );
362 static INLINE
struct ureg_src
363 ureg_imm1u( struct ureg_program
*ureg
,
366 return ureg_DECL_immediate_uint( ureg
, &a
, 1 );
369 static INLINE
struct ureg_src
370 ureg_imm4i( struct ureg_program
*ureg
,
379 return ureg_DECL_immediate_int( ureg
, v
, 4 );
382 static INLINE
struct ureg_src
383 ureg_imm3i( struct ureg_program
*ureg
,
391 return ureg_DECL_immediate_int( ureg
, v
, 3 );
394 static INLINE
struct ureg_src
395 ureg_imm2i( struct ureg_program
*ureg
,
401 return ureg_DECL_immediate_int( ureg
, v
, 2 );
404 static INLINE
struct ureg_src
405 ureg_imm1i( struct ureg_program
*ureg
,
408 return ureg_DECL_immediate_int( ureg
, &a
, 1 );
411 /***********************************************************************
412 * Functions for patching up labels
416 /* Will return a number which can be used in a label to point to the
417 * next instruction to be emitted.
420 ureg_get_instruction_number( struct ureg_program
*ureg
);
423 /* Patch a given label (expressed as a token number) to point to a
424 * given instruction (expressed as an instruction number).
426 * Labels are obtained from instruction emitters, eg ureg_CAL().
427 * Instruction numbers are obtained from ureg_get_instruction_number(),
431 ureg_fixup_label(struct ureg_program
*ureg
,
432 unsigned label_token
,
433 unsigned instruction_number
);
436 /* Generic instruction emitter. Use if you need to pass the opcode as
437 * a parameter, rather than using the emit_OP() variants below.
440 ureg_insn(struct ureg_program
*ureg
,
442 const struct ureg_dst
*dst
,
444 const struct ureg_src
*src
,
449 ureg_tex_insn(struct ureg_program
*ureg
,
451 const struct ureg_dst
*dst
,
454 const struct ureg_src
*src
,
459 ureg_label_insn(struct ureg_program
*ureg
,
461 const struct ureg_src
*src
,
466 /***********************************************************************
467 * Internal instruction helpers, don't call these directly:
470 struct ureg_emit_insn_result
{
471 unsigned insn_token
; /*< Used to fixup insn size. */
472 unsigned extended_token
; /*< Used to set the Extended bit, usually the same as insn_token. */
475 struct ureg_emit_insn_result
476 ureg_emit_insn(struct ureg_program
*ureg
,
481 unsigned pred_swizzle_x
,
482 unsigned pred_swizzle_y
,
483 unsigned pred_swizzle_z
,
484 unsigned pred_swizzle_w
,
489 ureg_emit_label(struct ureg_program
*ureg
,
491 unsigned *label_token
);
494 ureg_emit_texture(struct ureg_program
*ureg
,
499 ureg_emit_dst( struct ureg_program
*ureg
,
500 struct ureg_dst dst
);
503 ureg_emit_src( struct ureg_program
*ureg
,
504 struct ureg_src src
);
507 ureg_fixup_insn_size(struct ureg_program
*ureg
,
512 static INLINE void ureg_##op( struct ureg_program *ureg ) \
514 unsigned opcode = TGSI_OPCODE_##op; \
515 unsigned insn = ureg_emit_insn(ureg, \
526 ureg_fixup_insn_size( ureg, insn ); \
530 static INLINE void ureg_##op( struct ureg_program *ureg, \
531 struct ureg_src src ) \
533 unsigned opcode = TGSI_OPCODE_##op; \
534 unsigned insn = ureg_emit_insn(ureg, \
545 ureg_emit_src( ureg, src ); \
546 ureg_fixup_insn_size( ureg, insn ); \
549 #define OP00_LBL( op ) \
550 static INLINE void ureg_##op( struct ureg_program *ureg, \
551 unsigned *label_token ) \
553 unsigned opcode = TGSI_OPCODE_##op; \
554 struct ureg_emit_insn_result insn; \
555 insn = ureg_emit_insn(ureg, \
566 ureg_emit_label( ureg, insn.extended_token, label_token ); \
567 ureg_fixup_insn_size( ureg, insn.insn_token ); \
570 #define OP01_LBL( op ) \
571 static INLINE void ureg_##op( struct ureg_program *ureg, \
572 struct ureg_src src, \
573 unsigned *label_token ) \
575 unsigned opcode = TGSI_OPCODE_##op; \
576 struct ureg_emit_insn_result insn; \
577 insn = ureg_emit_insn(ureg, \
588 ureg_emit_label( ureg, insn.extended_token, label_token ); \
589 ureg_emit_src( ureg, src ); \
590 ureg_fixup_insn_size( ureg, insn.insn_token ); \
594 static INLINE void ureg_##op( struct ureg_program *ureg, \
595 struct ureg_dst dst ) \
597 unsigned opcode = TGSI_OPCODE_##op; \
598 unsigned insn = ureg_emit_insn(ureg, \
609 ureg_emit_dst( ureg, dst ); \
610 ureg_fixup_insn_size( ureg, insn ); \
615 static INLINE void ureg_##op( struct ureg_program *ureg, \
616 struct ureg_dst dst, \
617 struct ureg_src src ) \
619 unsigned opcode = TGSI_OPCODE_##op; \
620 unsigned insn = ureg_emit_insn(ureg, \
631 ureg_emit_dst( ureg, dst ); \
632 ureg_emit_src( ureg, src ); \
633 ureg_fixup_insn_size( ureg, insn ); \
637 static INLINE void ureg_##op( struct ureg_program *ureg, \
638 struct ureg_dst dst, \
639 struct ureg_src src0, \
640 struct ureg_src src1 ) \
642 unsigned opcode = TGSI_OPCODE_##op; \
643 unsigned insn = ureg_emit_insn(ureg, \
654 ureg_emit_dst( ureg, dst ); \
655 ureg_emit_src( ureg, src0 ); \
656 ureg_emit_src( ureg, src1 ); \
657 ureg_fixup_insn_size( ureg, insn ); \
660 #define OP12_TEX( op ) \
661 static INLINE void ureg_##op( struct ureg_program *ureg, \
662 struct ureg_dst dst, \
664 struct ureg_src src0, \
665 struct ureg_src src1 ) \
667 unsigned opcode = TGSI_OPCODE_##op; \
668 struct ureg_emit_insn_result insn; \
669 insn = ureg_emit_insn(ureg, \
680 ureg_emit_texture( ureg, insn.extended_token, target ); \
681 ureg_emit_dst( ureg, dst ); \
682 ureg_emit_src( ureg, src0 ); \
683 ureg_emit_src( ureg, src1 ); \
684 ureg_fixup_insn_size( ureg, insn.insn_token ); \
688 static INLINE void ureg_##op( struct ureg_program *ureg, \
689 struct ureg_dst dst, \
690 struct ureg_src src0, \
691 struct ureg_src src1, \
692 struct ureg_src src2 ) \
694 unsigned opcode = TGSI_OPCODE_##op; \
695 unsigned insn = ureg_emit_insn(ureg, \
706 ureg_emit_dst( ureg, dst ); \
707 ureg_emit_src( ureg, src0 ); \
708 ureg_emit_src( ureg, src1 ); \
709 ureg_emit_src( ureg, src2 ); \
710 ureg_fixup_insn_size( ureg, insn ); \
713 #define OP14_TEX( op ) \
714 static INLINE void ureg_##op( struct ureg_program *ureg, \
715 struct ureg_dst dst, \
717 struct ureg_src src0, \
718 struct ureg_src src1, \
719 struct ureg_src src2, \
720 struct ureg_src src3 ) \
722 unsigned opcode = TGSI_OPCODE_##op; \
723 struct ureg_emit_insn_result insn; \
724 insn = ureg_emit_insn(ureg, \
735 ureg_emit_texture( ureg, insn.extended_token, target ); \
736 ureg_emit_dst( ureg, dst ); \
737 ureg_emit_src( ureg, src0 ); \
738 ureg_emit_src( ureg, src1 ); \
739 ureg_emit_src( ureg, src2 ); \
740 ureg_emit_src( ureg, src3 ); \
741 ureg_fixup_insn_size( ureg, insn.insn_token ); \
746 static INLINE void ureg_##op( struct ureg_program *ureg, \
747 struct ureg_dst dst, \
748 struct ureg_src src0, \
749 struct ureg_src src1, \
750 struct ureg_src src2, \
751 struct ureg_src src3 ) \
753 unsigned opcode = TGSI_OPCODE_##op; \
754 unsigned insn = ureg_emit_insn(ureg, \
765 ureg_emit_dst( ureg, dst ); \
766 ureg_emit_src( ureg, src0 ); \
767 ureg_emit_src( ureg, src1 ); \
768 ureg_emit_src( ureg, src2 ); \
769 ureg_emit_src( ureg, src3 ); \
770 ureg_fixup_insn_size( ureg, insn ); \
775 static INLINE void ureg_##op( struct ureg_program *ureg, \
776 struct ureg_dst dst, \
777 struct ureg_src src0, \
778 struct ureg_src src1, \
779 struct ureg_src src2, \
780 struct ureg_src src3, \
781 struct ureg_src src4 ) \
783 unsigned opcode = TGSI_OPCODE_##op; \
784 unsigned insn = ureg_emit_insn(ureg, \
795 ureg_emit_dst( ureg, dst ); \
796 ureg_emit_src( ureg, src0 ); \
797 ureg_emit_src( ureg, src1 ); \
798 ureg_emit_src( ureg, src2 ); \
799 ureg_emit_src( ureg, src3 ); \
800 ureg_emit_src( ureg, src4 ); \
801 ureg_fixup_insn_size( ureg, insn ); \
805 /* Use a template include to generate a correctly-typed ureg_OP()
806 * function for each TGSI opcode:
808 #include "tgsi_opcode_tmp.h"
811 /***********************************************************************
812 * Inline helpers for manipulating register structs:
814 static INLINE
struct ureg_src
815 ureg_negate( struct ureg_src reg
)
817 assert(reg
.File
!= TGSI_FILE_NULL
);
822 static INLINE
struct ureg_src
823 ureg_abs( struct ureg_src reg
)
825 assert(reg
.File
!= TGSI_FILE_NULL
);
831 static INLINE
struct ureg_src
832 ureg_swizzle( struct ureg_src reg
,
833 int x
, int y
, int z
, int w
)
835 unsigned swz
= ( (reg
.SwizzleX
<< 0) |
836 (reg
.SwizzleY
<< 2) |
837 (reg
.SwizzleZ
<< 4) |
838 (reg
.SwizzleW
<< 6));
840 assert(reg
.File
!= TGSI_FILE_NULL
);
846 reg
.SwizzleX
= (swz
>> (x
*2)) & 0x3;
847 reg
.SwizzleY
= (swz
>> (y
*2)) & 0x3;
848 reg
.SwizzleZ
= (swz
>> (z
*2)) & 0x3;
849 reg
.SwizzleW
= (swz
>> (w
*2)) & 0x3;
853 static INLINE
struct ureg_src
854 ureg_scalar( struct ureg_src reg
, int x
)
856 return ureg_swizzle(reg
, x
, x
, x
, x
);
859 static INLINE
struct ureg_dst
860 ureg_writemask( struct ureg_dst reg
,
863 assert(reg
.File
!= TGSI_FILE_NULL
);
864 reg
.WriteMask
&= writemask
;
868 static INLINE
struct ureg_dst
869 ureg_saturate( struct ureg_dst reg
)
871 assert(reg
.File
!= TGSI_FILE_NULL
);
876 static INLINE
struct ureg_dst
877 ureg_predicate(struct ureg_dst reg
,
884 assert(reg
.File
!= TGSI_FILE_NULL
);
886 reg
.PredNegate
= negate
;
887 reg
.PredSwizzleX
= swizzle_x
;
888 reg
.PredSwizzleY
= swizzle_y
;
889 reg
.PredSwizzleZ
= swizzle_z
;
890 reg
.PredSwizzleW
= swizzle_w
;
894 static INLINE
struct ureg_dst
895 ureg_dst_indirect( struct ureg_dst reg
, struct ureg_src addr
)
897 assert(reg
.File
!= TGSI_FILE_NULL
);
898 assert(addr
.File
== TGSI_FILE_ADDRESS
);
900 reg
.IndirectIndex
= addr
.Index
;
901 reg
.IndirectSwizzle
= addr
.SwizzleX
;
905 static INLINE
struct ureg_src
906 ureg_src_indirect( struct ureg_src reg
, struct ureg_src addr
)
908 assert(reg
.File
!= TGSI_FILE_NULL
);
909 assert(addr
.File
== TGSI_FILE_ADDRESS
|| addr
.File
== TGSI_FILE_TEMPORARY
);
911 reg
.IndirectFile
= addr
.File
;
912 reg
.IndirectIndex
= addr
.Index
;
913 reg
.IndirectSwizzle
= addr
.SwizzleX
;
917 static INLINE
struct ureg_src
918 ureg_src_dimension( struct ureg_src reg
, int index
)
920 assert(reg
.File
!= TGSI_FILE_NULL
);
923 reg
.DimensionIndex
= index
;
928 static INLINE
struct ureg_src
929 ureg_src_dimension_indirect( struct ureg_src reg
, struct ureg_src addr
,
932 assert(reg
.File
!= TGSI_FILE_NULL
);
935 reg
.DimensionIndex
= index
;
936 reg
.DimIndFile
= addr
.File
;
937 reg
.DimIndIndex
= addr
.Index
;
938 reg
.DimIndSwizzle
= addr
.SwizzleX
;
942 static INLINE
struct ureg_dst
943 ureg_dst( struct ureg_src src
)
947 assert(!src
.Indirect
|| src
.IndirectFile
== TGSI_FILE_ADDRESS
);
950 dst
.WriteMask
= TGSI_WRITEMASK_XYZW
;
951 dst
.Indirect
= src
.Indirect
;
952 dst
.IndirectIndex
= src
.IndirectIndex
;
953 dst
.IndirectSwizzle
= src
.IndirectSwizzle
;
957 dst
.PredSwizzleX
= TGSI_SWIZZLE_X
;
958 dst
.PredSwizzleY
= TGSI_SWIZZLE_Y
;
959 dst
.PredSwizzleZ
= TGSI_SWIZZLE_Z
;
960 dst
.PredSwizzleW
= TGSI_SWIZZLE_W
;
961 dst
.Index
= src
.Index
;
966 static INLINE
struct ureg_src
967 ureg_src_register(unsigned file
,
973 src
.SwizzleX
= TGSI_SWIZZLE_X
;
974 src
.SwizzleY
= TGSI_SWIZZLE_Y
;
975 src
.SwizzleZ
= TGSI_SWIZZLE_Z
;
976 src
.SwizzleW
= TGSI_SWIZZLE_W
;
978 src
.IndirectFile
= TGSI_FILE_NULL
;
979 src
.IndirectIndex
= 0;
980 src
.IndirectSwizzle
= 0;
985 src
.DimensionIndex
= 0;
987 src
.DimIndFile
= TGSI_FILE_NULL
;
989 src
.DimIndSwizzle
= 0;
994 static INLINE
struct ureg_src
995 ureg_src( struct ureg_dst dst
)
1000 src
.SwizzleX
= TGSI_SWIZZLE_X
;
1001 src
.SwizzleY
= TGSI_SWIZZLE_Y
;
1002 src
.SwizzleZ
= TGSI_SWIZZLE_Z
;
1003 src
.SwizzleW
= TGSI_SWIZZLE_W
;
1004 src
.Indirect
= dst
.Indirect
;
1005 src
.IndirectFile
= TGSI_FILE_ADDRESS
;
1006 src
.IndirectIndex
= dst
.IndirectIndex
;
1007 src
.IndirectSwizzle
= dst
.IndirectSwizzle
;
1009 src
.Index
= dst
.Index
;
1012 src
.DimensionIndex
= 0;
1013 src
.DimIndirect
= 0;
1014 src
.DimIndFile
= TGSI_FILE_NULL
;
1015 src
.DimIndIndex
= 0;
1016 src
.DimIndSwizzle
= 0;
1023 static INLINE
struct ureg_dst
1024 ureg_dst_undef( void )
1026 struct ureg_dst dst
;
1028 dst
.File
= TGSI_FILE_NULL
;
1031 dst
.IndirectIndex
= 0;
1032 dst
.IndirectSwizzle
= 0;
1036 dst
.PredSwizzleX
= TGSI_SWIZZLE_X
;
1037 dst
.PredSwizzleY
= TGSI_SWIZZLE_Y
;
1038 dst
.PredSwizzleZ
= TGSI_SWIZZLE_Z
;
1039 dst
.PredSwizzleW
= TGSI_SWIZZLE_W
;
1045 static INLINE
struct ureg_src
1046 ureg_src_undef( void )
1048 struct ureg_src src
;
1050 src
.File
= TGSI_FILE_NULL
;
1056 src
.IndirectFile
= TGSI_FILE_NULL
;
1057 src
.IndirectIndex
= 0;
1058 src
.IndirectSwizzle
= 0;
1063 src
.DimensionIndex
= 0;
1064 src
.DimIndirect
= 0;
1065 src
.DimIndFile
= TGSI_FILE_NULL
;
1066 src
.DimIndIndex
= 0;
1067 src
.DimIndSwizzle
= 0;
1072 static INLINE boolean
1073 ureg_src_is_undef( struct ureg_src src
)
1075 return src
.File
== TGSI_FILE_NULL
;
1078 static INLINE boolean
1079 ureg_dst_is_undef( struct ureg_dst dst
)
1081 return dst
.File
== TGSI_FILE_NULL
;