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 int Index
: 16; /* SINT */
57 unsigned IndirectFile
: 4; /* TGSI_FILE_ */
58 int IndirectIndex
: 16; /* SINT */
59 unsigned IndirectSwizzle
: 2; /* TGSI_SWIZZLE_ */
60 int DimensionIndex
: 16; /* SINT */
61 unsigned DimIndFile
: 4; /* TGSI_FILE_ */
62 int DimIndIndex
: 16; /* SINT */
63 unsigned DimIndSwizzle
: 2; /* TGSI_SWIZZLE_ */
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 varient 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 static INLINE
struct ureg_src
275 ureg_imm4f( struct ureg_program
*ureg
,
284 return ureg_DECL_immediate( ureg
, v
, 4 );
287 static INLINE
struct ureg_src
288 ureg_imm3f( struct ureg_program
*ureg
,
296 return ureg_DECL_immediate( ureg
, v
, 3 );
299 static INLINE
struct ureg_src
300 ureg_imm2f( struct ureg_program
*ureg
,
306 return ureg_DECL_immediate( ureg
, v
, 2 );
309 static INLINE
struct ureg_src
310 ureg_imm1f( struct ureg_program
*ureg
,
315 return ureg_DECL_immediate( ureg
, v
, 1 );
318 static INLINE
struct ureg_src
319 ureg_imm4u( struct ureg_program
*ureg
,
320 unsigned a
, unsigned b
,
321 unsigned c
, unsigned d
)
328 return ureg_DECL_immediate_uint( ureg
, v
, 4 );
331 static INLINE
struct ureg_src
332 ureg_imm3u( struct ureg_program
*ureg
,
333 unsigned a
, unsigned b
,
340 return ureg_DECL_immediate_uint( ureg
, v
, 3 );
343 static INLINE
struct ureg_src
344 ureg_imm2u( struct ureg_program
*ureg
,
345 unsigned a
, unsigned b
)
350 return ureg_DECL_immediate_uint( ureg
, v
, 2 );
353 static INLINE
struct ureg_src
354 ureg_imm1u( struct ureg_program
*ureg
,
357 return ureg_DECL_immediate_uint( ureg
, &a
, 1 );
360 static INLINE
struct ureg_src
361 ureg_imm4i( struct ureg_program
*ureg
,
370 return ureg_DECL_immediate_int( ureg
, v
, 4 );
373 static INLINE
struct ureg_src
374 ureg_imm3i( struct ureg_program
*ureg
,
382 return ureg_DECL_immediate_int( ureg
, v
, 3 );
385 static INLINE
struct ureg_src
386 ureg_imm2i( struct ureg_program
*ureg
,
392 return ureg_DECL_immediate_int( ureg
, v
, 2 );
395 static INLINE
struct ureg_src
396 ureg_imm1i( struct ureg_program
*ureg
,
399 return ureg_DECL_immediate_int( ureg
, &a
, 1 );
402 /***********************************************************************
403 * Functions for patching up labels
407 /* Will return a number which can be used in a label to point to the
408 * next instruction to be emitted.
411 ureg_get_instruction_number( struct ureg_program
*ureg
);
414 /* Patch a given label (expressed as a token number) to point to a
415 * given instruction (expressed as an instruction number).
417 * Labels are obtained from instruction emitters, eg ureg_CAL().
418 * Instruction numbers are obtained from ureg_get_instruction_number(),
422 ureg_fixup_label(struct ureg_program
*ureg
,
423 unsigned label_token
,
424 unsigned instruction_number
);
427 /* Generic instruction emitter. Use if you need to pass the opcode as
428 * a parameter, rather than using the emit_OP() varients below.
431 ureg_insn(struct ureg_program
*ureg
,
433 const struct ureg_dst
*dst
,
435 const struct ureg_src
*src
,
440 ureg_tex_insn(struct ureg_program
*ureg
,
442 const struct ureg_dst
*dst
,
445 const struct ureg_src
*src
,
450 ureg_label_insn(struct ureg_program
*ureg
,
452 const struct ureg_src
*src
,
457 /***********************************************************************
458 * Internal instruction helpers, don't call these directly:
461 struct ureg_emit_insn_result
{
462 unsigned insn_token
; /*< Used to fixup insn size. */
463 unsigned extended_token
; /*< Used to set the Extended bit, usually the same as insn_token. */
466 struct ureg_emit_insn_result
467 ureg_emit_insn(struct ureg_program
*ureg
,
472 unsigned pred_swizzle_x
,
473 unsigned pred_swizzle_y
,
474 unsigned pred_swizzle_z
,
475 unsigned pred_swizzle_w
,
480 ureg_emit_label(struct ureg_program
*ureg
,
482 unsigned *label_token
);
485 ureg_emit_texture(struct ureg_program
*ureg
,
490 ureg_emit_dst( struct ureg_program
*ureg
,
491 struct ureg_dst dst
);
494 ureg_emit_src( struct ureg_program
*ureg
,
495 struct ureg_src src
);
498 ureg_fixup_insn_size(struct ureg_program
*ureg
,
503 static INLINE void ureg_##op( struct ureg_program *ureg ) \
505 unsigned opcode = TGSI_OPCODE_##op; \
506 unsigned insn = ureg_emit_insn(ureg, \
517 ureg_fixup_insn_size( ureg, insn ); \
521 static INLINE void ureg_##op( struct ureg_program *ureg, \
522 struct ureg_src src ) \
524 unsigned opcode = TGSI_OPCODE_##op; \
525 unsigned insn = ureg_emit_insn(ureg, \
536 ureg_emit_src( ureg, src ); \
537 ureg_fixup_insn_size( ureg, insn ); \
540 #define OP00_LBL( op ) \
541 static INLINE void ureg_##op( struct ureg_program *ureg, \
542 unsigned *label_token ) \
544 unsigned opcode = TGSI_OPCODE_##op; \
545 struct ureg_emit_insn_result insn; \
546 insn = ureg_emit_insn(ureg, \
557 ureg_emit_label( ureg, insn.extended_token, label_token ); \
558 ureg_fixup_insn_size( ureg, insn.insn_token ); \
561 #define OP01_LBL( op ) \
562 static INLINE void ureg_##op( struct ureg_program *ureg, \
563 struct ureg_src src, \
564 unsigned *label_token ) \
566 unsigned opcode = TGSI_OPCODE_##op; \
567 struct ureg_emit_insn_result insn; \
568 insn = ureg_emit_insn(ureg, \
579 ureg_emit_label( ureg, insn.extended_token, label_token ); \
580 ureg_emit_src( ureg, src ); \
581 ureg_fixup_insn_size( ureg, insn.insn_token ); \
585 static INLINE void ureg_##op( struct ureg_program *ureg, \
586 struct ureg_dst dst ) \
588 unsigned opcode = TGSI_OPCODE_##op; \
589 unsigned insn = ureg_emit_insn(ureg, \
600 ureg_emit_dst( ureg, dst ); \
601 ureg_fixup_insn_size( ureg, insn ); \
606 static INLINE void ureg_##op( struct ureg_program *ureg, \
607 struct ureg_dst dst, \
608 struct ureg_src src ) \
610 unsigned opcode = TGSI_OPCODE_##op; \
611 unsigned insn = ureg_emit_insn(ureg, \
622 ureg_emit_dst( ureg, dst ); \
623 ureg_emit_src( ureg, src ); \
624 ureg_fixup_insn_size( ureg, insn ); \
628 static INLINE void ureg_##op( struct ureg_program *ureg, \
629 struct ureg_dst dst, \
630 struct ureg_src src0, \
631 struct ureg_src src1 ) \
633 unsigned opcode = TGSI_OPCODE_##op; \
634 unsigned insn = ureg_emit_insn(ureg, \
645 ureg_emit_dst( ureg, dst ); \
646 ureg_emit_src( ureg, src0 ); \
647 ureg_emit_src( ureg, src1 ); \
648 ureg_fixup_insn_size( ureg, insn ); \
651 #define OP12_TEX( op ) \
652 static INLINE void ureg_##op( struct ureg_program *ureg, \
653 struct ureg_dst dst, \
655 struct ureg_src src0, \
656 struct ureg_src src1 ) \
658 unsigned opcode = TGSI_OPCODE_##op; \
659 struct ureg_emit_insn_result insn; \
660 insn = ureg_emit_insn(ureg, \
671 ureg_emit_texture( ureg, insn.extended_token, target ); \
672 ureg_emit_dst( ureg, dst ); \
673 ureg_emit_src( ureg, src0 ); \
674 ureg_emit_src( ureg, src1 ); \
675 ureg_fixup_insn_size( ureg, insn.insn_token ); \
679 static INLINE void ureg_##op( struct ureg_program *ureg, \
680 struct ureg_dst dst, \
681 struct ureg_src src0, \
682 struct ureg_src src1, \
683 struct ureg_src src2 ) \
685 unsigned opcode = TGSI_OPCODE_##op; \
686 unsigned insn = ureg_emit_insn(ureg, \
697 ureg_emit_dst( ureg, dst ); \
698 ureg_emit_src( ureg, src0 ); \
699 ureg_emit_src( ureg, src1 ); \
700 ureg_emit_src( ureg, src2 ); \
701 ureg_fixup_insn_size( ureg, insn ); \
704 #define OP14_TEX( op ) \
705 static INLINE void ureg_##op( struct ureg_program *ureg, \
706 struct ureg_dst dst, \
708 struct ureg_src src0, \
709 struct ureg_src src1, \
710 struct ureg_src src2, \
711 struct ureg_src src3 ) \
713 unsigned opcode = TGSI_OPCODE_##op; \
714 struct ureg_emit_insn_result insn; \
715 insn = ureg_emit_insn(ureg, \
726 ureg_emit_texture( ureg, insn.extended_token, target ); \
727 ureg_emit_dst( ureg, dst ); \
728 ureg_emit_src( ureg, src0 ); \
729 ureg_emit_src( ureg, src1 ); \
730 ureg_emit_src( ureg, src2 ); \
731 ureg_emit_src( ureg, src3 ); \
732 ureg_fixup_insn_size( ureg, insn.insn_token ); \
736 /* Use a template include to generate a correctly-typed ureg_OP()
737 * function for each TGSI opcode:
739 #include "tgsi_opcode_tmp.h"
742 /***********************************************************************
743 * Inline helpers for manipulating register structs:
745 static INLINE
struct ureg_src
746 ureg_negate( struct ureg_src reg
)
748 assert(reg
.File
!= TGSI_FILE_NULL
);
753 static INLINE
struct ureg_src
754 ureg_abs( struct ureg_src reg
)
756 assert(reg
.File
!= TGSI_FILE_NULL
);
762 static INLINE
struct ureg_src
763 ureg_swizzle( struct ureg_src reg
,
764 int x
, int y
, int z
, int w
)
766 unsigned swz
= ( (reg
.SwizzleX
<< 0) |
767 (reg
.SwizzleY
<< 2) |
768 (reg
.SwizzleZ
<< 4) |
769 (reg
.SwizzleW
<< 6));
771 assert(reg
.File
!= TGSI_FILE_NULL
);
777 reg
.SwizzleX
= (swz
>> (x
*2)) & 0x3;
778 reg
.SwizzleY
= (swz
>> (y
*2)) & 0x3;
779 reg
.SwizzleZ
= (swz
>> (z
*2)) & 0x3;
780 reg
.SwizzleW
= (swz
>> (w
*2)) & 0x3;
784 static INLINE
struct ureg_src
785 ureg_scalar( struct ureg_src reg
, int x
)
787 return ureg_swizzle(reg
, x
, x
, x
, x
);
790 static INLINE
struct ureg_dst
791 ureg_writemask( struct ureg_dst reg
,
794 assert(reg
.File
!= TGSI_FILE_NULL
);
795 reg
.WriteMask
&= writemask
;
799 static INLINE
struct ureg_dst
800 ureg_saturate( struct ureg_dst reg
)
802 assert(reg
.File
!= TGSI_FILE_NULL
);
807 static INLINE
struct ureg_dst
808 ureg_predicate(struct ureg_dst reg
,
815 assert(reg
.File
!= TGSI_FILE_NULL
);
817 reg
.PredNegate
= negate
;
818 reg
.PredSwizzleX
= swizzle_x
;
819 reg
.PredSwizzleY
= swizzle_y
;
820 reg
.PredSwizzleZ
= swizzle_z
;
821 reg
.PredSwizzleW
= swizzle_w
;
825 static INLINE
struct ureg_dst
826 ureg_dst_indirect( struct ureg_dst reg
, struct ureg_src addr
)
828 assert(reg
.File
!= TGSI_FILE_NULL
);
829 assert(addr
.File
== TGSI_FILE_ADDRESS
);
831 reg
.IndirectIndex
= addr
.Index
;
832 reg
.IndirectSwizzle
= addr
.SwizzleX
;
836 static INLINE
struct ureg_src
837 ureg_src_indirect( struct ureg_src reg
, struct ureg_src addr
)
839 assert(reg
.File
!= TGSI_FILE_NULL
);
840 assert(addr
.File
== TGSI_FILE_ADDRESS
|| addr
.File
== TGSI_FILE_TEMPORARY
);
842 reg
.IndirectFile
= addr
.File
;
843 reg
.IndirectIndex
= addr
.Index
;
844 reg
.IndirectSwizzle
= addr
.SwizzleX
;
848 static INLINE
struct ureg_src
849 ureg_src_dimension( struct ureg_src reg
, int index
)
851 assert(reg
.File
!= TGSI_FILE_NULL
);
854 reg
.DimensionIndex
= index
;
859 static INLINE
struct ureg_src
860 ureg_src_dimension_indirect( struct ureg_src reg
, struct ureg_src addr
,
863 assert(reg
.File
!= TGSI_FILE_NULL
);
866 reg
.DimensionIndex
= index
;
867 reg
.DimIndFile
= addr
.File
;
868 reg
.DimIndIndex
= addr
.Index
;
869 reg
.DimIndSwizzle
= addr
.SwizzleX
;
873 static INLINE
struct ureg_dst
874 ureg_dst( struct ureg_src src
)
878 assert(!src
.Indirect
|| src
.IndirectFile
== TGSI_FILE_ADDRESS
);
881 dst
.WriteMask
= TGSI_WRITEMASK_XYZW
;
882 dst
.Indirect
= src
.Indirect
;
883 dst
.IndirectIndex
= src
.IndirectIndex
;
884 dst
.IndirectSwizzle
= src
.IndirectSwizzle
;
888 dst
.PredSwizzleX
= TGSI_SWIZZLE_X
;
889 dst
.PredSwizzleY
= TGSI_SWIZZLE_Y
;
890 dst
.PredSwizzleZ
= TGSI_SWIZZLE_Z
;
891 dst
.PredSwizzleW
= TGSI_SWIZZLE_W
;
892 dst
.Index
= src
.Index
;
897 static INLINE
struct ureg_src
898 ureg_src_register(unsigned file
,
904 src
.SwizzleX
= TGSI_SWIZZLE_X
;
905 src
.SwizzleY
= TGSI_SWIZZLE_Y
;
906 src
.SwizzleZ
= TGSI_SWIZZLE_Z
;
907 src
.SwizzleW
= TGSI_SWIZZLE_W
;
909 src
.IndirectFile
= TGSI_FILE_NULL
;
910 src
.IndirectIndex
= 0;
911 src
.IndirectSwizzle
= 0;
916 src
.DimensionIndex
= 0;
918 src
.DimIndFile
= TGSI_FILE_NULL
;
920 src
.DimIndSwizzle
= 0;
925 static INLINE
struct ureg_src
926 ureg_src( struct ureg_dst dst
)
931 src
.SwizzleX
= TGSI_SWIZZLE_X
;
932 src
.SwizzleY
= TGSI_SWIZZLE_Y
;
933 src
.SwizzleZ
= TGSI_SWIZZLE_Z
;
934 src
.SwizzleW
= TGSI_SWIZZLE_W
;
935 src
.Indirect
= dst
.Indirect
;
936 src
.IndirectFile
= TGSI_FILE_ADDRESS
;
937 src
.IndirectIndex
= dst
.IndirectIndex
;
938 src
.IndirectSwizzle
= dst
.IndirectSwizzle
;
940 src
.Index
= dst
.Index
;
943 src
.DimensionIndex
= 0;
945 src
.DimIndFile
= TGSI_FILE_NULL
;
947 src
.DimIndSwizzle
= 0;
954 static INLINE
struct ureg_dst
955 ureg_dst_undef( void )
959 dst
.File
= TGSI_FILE_NULL
;
962 dst
.IndirectIndex
= 0;
963 dst
.IndirectSwizzle
= 0;
967 dst
.PredSwizzleX
= TGSI_SWIZZLE_X
;
968 dst
.PredSwizzleY
= TGSI_SWIZZLE_Y
;
969 dst
.PredSwizzleZ
= TGSI_SWIZZLE_Z
;
970 dst
.PredSwizzleW
= TGSI_SWIZZLE_W
;
976 static INLINE
struct ureg_src
977 ureg_src_undef( void )
981 src
.File
= TGSI_FILE_NULL
;
987 src
.IndirectFile
= TGSI_FILE_NULL
;
988 src
.IndirectIndex
= 0;
989 src
.IndirectSwizzle
= 0;
994 src
.DimensionIndex
= 0;
996 src
.DimIndFile
= TGSI_FILE_NULL
;
998 src
.DimIndSwizzle
= 0;
1003 static INLINE boolean
1004 ureg_src_is_undef( struct ureg_src src
)
1006 return src
.File
== TGSI_FILE_NULL
;
1009 static INLINE boolean
1010 ureg_dst_is_undef( struct ureg_dst dst
)
1012 return dst
.File
== TGSI_FILE_NULL
;