1 /**************************************************************************
3 * Copyright 2008 VMware, Inc.
5 * Copyright 2008 VMware, Inc. All rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
30 * TGSI program scan utility.
31 * Used to determine which registers and instructions are used by a shader.
37 #include "util/u_debug.h"
38 #include "util/u_math.h"
39 #include "util/u_memory.h"
40 #include "util/u_prim.h"
41 #include "tgsi/tgsi_info.h"
42 #include "tgsi/tgsi_parse.h"
43 #include "tgsi/tgsi_util.h"
44 #include "tgsi/tgsi_scan.h"
48 is_memory_file(unsigned file
)
50 return file
== TGSI_FILE_SAMPLER
||
51 file
== TGSI_FILE_SAMPLER_VIEW
||
52 file
== TGSI_FILE_IMAGE
||
53 file
== TGSI_FILE_BUFFER
;
58 * Is the opcode a "true" texture instruction which samples from a
62 is_texture_inst(unsigned opcode
)
64 return (opcode
!= TGSI_OPCODE_TXQ
&&
65 opcode
!= TGSI_OPCODE_TXQS
&&
66 opcode
!= TGSI_OPCODE_TXQ_LZ
&&
67 opcode
!= TGSI_OPCODE_LODQ
&&
68 tgsi_get_opcode_info(opcode
)->is_tex
);
72 scan_instruction(struct tgsi_shader_info
*info
,
73 const struct tgsi_full_instruction
*fullinst
,
74 unsigned *current_depth
)
77 bool is_mem_inst
= false;
79 assert(fullinst
->Instruction
.Opcode
< TGSI_OPCODE_LAST
);
80 info
->opcode_count
[fullinst
->Instruction
.Opcode
]++;
82 switch (fullinst
->Instruction
.Opcode
) {
85 case TGSI_OPCODE_BGNLOOP
:
87 info
->max_depth
= MAX2(info
->max_depth
, *current_depth
);
89 case TGSI_OPCODE_ENDIF
:
90 case TGSI_OPCODE_ENDLOOP
:
97 if (fullinst
->Instruction
.Opcode
== TGSI_OPCODE_INTERP_CENTROID
||
98 fullinst
->Instruction
.Opcode
== TGSI_OPCODE_INTERP_OFFSET
||
99 fullinst
->Instruction
.Opcode
== TGSI_OPCODE_INTERP_SAMPLE
) {
100 const struct tgsi_full_src_register
*src0
= &fullinst
->Src
[0];
103 if (src0
->Register
.Indirect
&& src0
->Indirect
.ArrayID
)
104 input
= info
->input_array_first
[src0
->Indirect
.ArrayID
];
106 input
= src0
->Register
.Index
;
108 /* For the INTERP opcodes, the interpolation is always
109 * PERSPECTIVE unless LINEAR is specified.
111 switch (info
->input_interpolate
[input
]) {
112 case TGSI_INTERPOLATE_COLOR
:
113 case TGSI_INTERPOLATE_CONSTANT
:
114 case TGSI_INTERPOLATE_PERSPECTIVE
:
115 switch (fullinst
->Instruction
.Opcode
) {
116 case TGSI_OPCODE_INTERP_CENTROID
:
117 info
->uses_persp_opcode_interp_centroid
= TRUE
;
119 case TGSI_OPCODE_INTERP_OFFSET
:
120 info
->uses_persp_opcode_interp_offset
= TRUE
;
122 case TGSI_OPCODE_INTERP_SAMPLE
:
123 info
->uses_persp_opcode_interp_sample
= TRUE
;
128 case TGSI_INTERPOLATE_LINEAR
:
129 switch (fullinst
->Instruction
.Opcode
) {
130 case TGSI_OPCODE_INTERP_CENTROID
:
131 info
->uses_linear_opcode_interp_centroid
= TRUE
;
133 case TGSI_OPCODE_INTERP_OFFSET
:
134 info
->uses_linear_opcode_interp_offset
= TRUE
;
136 case TGSI_OPCODE_INTERP_SAMPLE
:
137 info
->uses_linear_opcode_interp_sample
= TRUE
;
144 if (fullinst
->Instruction
.Opcode
>= TGSI_OPCODE_F2D
&&
145 fullinst
->Instruction
.Opcode
<= TGSI_OPCODE_DSSG
)
146 info
->uses_doubles
= TRUE
;
148 for (i
= 0; i
< fullinst
->Instruction
.NumSrcRegs
; i
++) {
149 const struct tgsi_full_src_register
*src
= &fullinst
->Src
[i
];
150 int ind
= src
->Register
.Index
;
152 /* Mark which inputs are effectively used */
153 if (src
->Register
.File
== TGSI_FILE_INPUT
) {
155 usage_mask
= tgsi_util_get_inst_usage_mask(fullinst
, i
);
156 if (src
->Register
.Indirect
) {
157 for (ind
= 0; ind
< info
->num_inputs
; ++ind
) {
158 info
->input_usage_mask
[ind
] |= usage_mask
;
162 assert(ind
< PIPE_MAX_SHADER_INPUTS
);
163 info
->input_usage_mask
[ind
] |= usage_mask
;
166 if (info
->processor
== PIPE_SHADER_FRAGMENT
&&
167 !src
->Register
.Indirect
) {
169 info
->input_semantic_name
[src
->Register
.Index
];
171 info
->input_semantic_index
[src
->Register
.Index
];
173 if (name
== TGSI_SEMANTIC_POSITION
&&
174 (src
->Register
.SwizzleX
== TGSI_SWIZZLE_Z
||
175 src
->Register
.SwizzleY
== TGSI_SWIZZLE_Z
||
176 src
->Register
.SwizzleZ
== TGSI_SWIZZLE_Z
||
177 src
->Register
.SwizzleW
== TGSI_SWIZZLE_Z
))
178 info
->reads_z
= TRUE
;
180 if (name
== TGSI_SEMANTIC_COLOR
) {
182 (1 << src
->Register
.SwizzleX
) |
183 (1 << src
->Register
.SwizzleY
) |
184 (1 << src
->Register
.SwizzleZ
) |
185 (1 << src
->Register
.SwizzleW
);
187 info
->colors_read
|= mask
<< (index
* 4);
192 /* check for indirect register reads */
193 if (src
->Register
.Indirect
) {
194 info
->indirect_files
|= (1 << src
->Register
.File
);
195 info
->indirect_files_read
|= (1 << src
->Register
.File
);
198 /* Texture samplers */
199 if (src
->Register
.File
== TGSI_FILE_SAMPLER
) {
200 const unsigned index
= src
->Register
.Index
;
202 assert(fullinst
->Instruction
.Texture
);
203 assert(index
< ARRAY_SIZE(info
->is_msaa_sampler
));
204 assert(index
< PIPE_MAX_SAMPLERS
);
206 if (is_texture_inst(fullinst
->Instruction
.Opcode
)) {
207 const unsigned target
= fullinst
->Texture
.Texture
;
208 assert(target
< TGSI_TEXTURE_UNKNOWN
);
209 /* for texture instructions, check that the texture instruction
210 * target matches the previous sampler view declaration (if there
213 if (info
->sampler_targets
[index
] == TGSI_TEXTURE_UNKNOWN
) {
214 /* probably no sampler view declaration */
215 info
->sampler_targets
[index
] = target
;
217 /* Make sure the texture instruction's sampler/target info
218 * agrees with the sampler view declaration.
220 assert(info
->sampler_targets
[index
] == target
);
223 if (target
== TGSI_TEXTURE_2D_MSAA
||
224 target
== TGSI_TEXTURE_2D_ARRAY_MSAA
) {
225 info
->is_msaa_sampler
[src
->Register
.Index
] = TRUE
;
230 if (is_memory_file(src
->Register
.File
)) {
233 if (tgsi_get_opcode_info(fullinst
->Instruction
.Opcode
)->is_store
) {
234 info
->writes_memory
= TRUE
;
236 if (src
->Register
.File
== TGSI_FILE_IMAGE
&&
237 !src
->Register
.Indirect
)
238 info
->images_writemask
|= 1 << src
->Register
.Index
;
243 /* check for indirect register writes */
244 for (i
= 0; i
< fullinst
->Instruction
.NumDstRegs
; i
++) {
245 const struct tgsi_full_dst_register
*dst
= &fullinst
->Dst
[i
];
246 if (dst
->Register
.Indirect
) {
247 info
->indirect_files
|= (1 << dst
->Register
.File
);
248 info
->indirect_files_written
|= (1 << dst
->Register
.File
);
251 if (is_memory_file(dst
->Register
.File
)) {
252 assert(fullinst
->Instruction
.Opcode
== TGSI_OPCODE_STORE
);
255 info
->writes_memory
= TRUE
;
257 if (dst
->Register
.File
== TGSI_FILE_IMAGE
&&
258 !dst
->Register
.Indirect
)
259 info
->images_writemask
|= 1 << dst
->Register
.Index
;
264 info
->num_memory_instructions
++;
266 info
->num_instructions
++;
271 scan_declaration(struct tgsi_shader_info
*info
,
272 const struct tgsi_full_declaration
*fulldecl
)
274 const uint file
= fulldecl
->Declaration
.File
;
275 const unsigned procType
= info
->processor
;
278 if (fulldecl
->Declaration
.Array
) {
279 unsigned array_id
= fulldecl
->Array
.ArrayID
;
282 case TGSI_FILE_INPUT
:
283 assert(array_id
< ARRAY_SIZE(info
->input_array_first
));
284 info
->input_array_first
[array_id
] = fulldecl
->Range
.First
;
285 info
->input_array_last
[array_id
] = fulldecl
->Range
.Last
;
287 case TGSI_FILE_OUTPUT
:
288 assert(array_id
< ARRAY_SIZE(info
->output_array_first
));
289 info
->output_array_first
[array_id
] = fulldecl
->Range
.First
;
290 info
->output_array_last
[array_id
] = fulldecl
->Range
.Last
;
293 info
->array_max
[file
] = MAX2(info
->array_max
[file
], array_id
);
296 for (reg
= fulldecl
->Range
.First
; reg
<= fulldecl
->Range
.Last
; reg
++) {
297 unsigned semName
= fulldecl
->Semantic
.Name
;
298 unsigned semIndex
= fulldecl
->Semantic
.Index
+
299 (reg
- fulldecl
->Range
.First
);
301 /* only first 32 regs will appear in this bitfield */
302 info
->file_mask
[file
] |= (1 << reg
);
303 info
->file_count
[file
]++;
304 info
->file_max
[file
] = MAX2(info
->file_max
[file
], (int)reg
);
306 if (file
== TGSI_FILE_CONSTANT
) {
309 if (fulldecl
->Declaration
.Dimension
)
310 buffer
= fulldecl
->Dim
.Index2D
;
312 info
->const_file_max
[buffer
] =
313 MAX2(info
->const_file_max
[buffer
], (int)reg
);
315 else if (file
== TGSI_FILE_INPUT
) {
316 info
->input_semantic_name
[reg
] = (ubyte
) semName
;
317 info
->input_semantic_index
[reg
] = (ubyte
) semIndex
;
318 info
->input_interpolate
[reg
] = (ubyte
)fulldecl
->Interp
.Interpolate
;
319 info
->input_interpolate_loc
[reg
] = (ubyte
)fulldecl
->Interp
.Location
;
320 info
->input_cylindrical_wrap
[reg
] = (ubyte
)fulldecl
->Interp
.CylindricalWrap
;
322 /* Vertex shaders can have inputs with holes between them. */
323 if (info
->processor
== PIPE_SHADER_VERTEX
)
324 info
->num_inputs
= MAX2(info
->num_inputs
, reg
+ 1);
327 assert(reg
< info
->num_inputs
);
330 /* Only interpolated varyings. Don't include POSITION.
331 * Don't include integer varyings, because they are not
334 if (semName
== TGSI_SEMANTIC_GENERIC
||
335 semName
== TGSI_SEMANTIC_TEXCOORD
||
336 semName
== TGSI_SEMANTIC_COLOR
||
337 semName
== TGSI_SEMANTIC_BCOLOR
||
338 semName
== TGSI_SEMANTIC_FOG
||
339 semName
== TGSI_SEMANTIC_CLIPDIST
) {
340 switch (fulldecl
->Interp
.Interpolate
) {
341 case TGSI_INTERPOLATE_COLOR
:
342 case TGSI_INTERPOLATE_PERSPECTIVE
:
343 switch (fulldecl
->Interp
.Location
) {
344 case TGSI_INTERPOLATE_LOC_CENTER
:
345 info
->uses_persp_center
= TRUE
;
347 case TGSI_INTERPOLATE_LOC_CENTROID
:
348 info
->uses_persp_centroid
= TRUE
;
350 case TGSI_INTERPOLATE_LOC_SAMPLE
:
351 info
->uses_persp_sample
= TRUE
;
355 case TGSI_INTERPOLATE_LINEAR
:
356 switch (fulldecl
->Interp
.Location
) {
357 case TGSI_INTERPOLATE_LOC_CENTER
:
358 info
->uses_linear_center
= TRUE
;
360 case TGSI_INTERPOLATE_LOC_CENTROID
:
361 info
->uses_linear_centroid
= TRUE
;
363 case TGSI_INTERPOLATE_LOC_SAMPLE
:
364 info
->uses_linear_sample
= TRUE
;
368 /* TGSI_INTERPOLATE_CONSTANT doesn't do any interpolation. */
372 if (semName
== TGSI_SEMANTIC_PRIMID
)
373 info
->uses_primid
= TRUE
;
374 else if (procType
== PIPE_SHADER_FRAGMENT
) {
375 if (semName
== TGSI_SEMANTIC_POSITION
)
376 info
->reads_position
= TRUE
;
377 else if (semName
== TGSI_SEMANTIC_FACE
)
378 info
->uses_frontface
= TRUE
;
381 else if (file
== TGSI_FILE_SYSTEM_VALUE
) {
382 unsigned index
= fulldecl
->Range
.First
;
384 info
->system_value_semantic_name
[index
] = semName
;
385 info
->num_system_values
= MAX2(info
->num_system_values
, index
+ 1);
388 case TGSI_SEMANTIC_INSTANCEID
:
389 info
->uses_instanceid
= TRUE
;
391 case TGSI_SEMANTIC_VERTEXID
:
392 info
->uses_vertexid
= TRUE
;
394 case TGSI_SEMANTIC_VERTEXID_NOBASE
:
395 info
->uses_vertexid_nobase
= TRUE
;
397 case TGSI_SEMANTIC_BASEVERTEX
:
398 info
->uses_basevertex
= TRUE
;
400 case TGSI_SEMANTIC_PRIMID
:
401 info
->uses_primid
= TRUE
;
403 case TGSI_SEMANTIC_INVOCATIONID
:
404 info
->uses_invocationid
= TRUE
;
406 case TGSI_SEMANTIC_POSITION
:
407 info
->reads_position
= TRUE
;
409 case TGSI_SEMANTIC_FACE
:
410 info
->uses_frontface
= TRUE
;
412 case TGSI_SEMANTIC_SAMPLEMASK
:
413 info
->reads_samplemask
= TRUE
;
417 else if (file
== TGSI_FILE_OUTPUT
) {
418 info
->output_semantic_name
[reg
] = (ubyte
) semName
;
419 info
->output_semantic_index
[reg
] = (ubyte
) semIndex
;
421 assert(reg
< info
->num_outputs
);
423 if (semName
== TGSI_SEMANTIC_COLOR
)
424 info
->colors_written
|= 1 << semIndex
;
426 if (procType
== PIPE_SHADER_VERTEX
||
427 procType
== PIPE_SHADER_GEOMETRY
||
428 procType
== PIPE_SHADER_TESS_CTRL
||
429 procType
== PIPE_SHADER_TESS_EVAL
) {
431 case TGSI_SEMANTIC_VIEWPORT_INDEX
:
432 info
->writes_viewport_index
= TRUE
;
434 case TGSI_SEMANTIC_LAYER
:
435 info
->writes_layer
= TRUE
;
437 case TGSI_SEMANTIC_PSIZE
:
438 info
->writes_psize
= TRUE
;
440 case TGSI_SEMANTIC_CLIPVERTEX
:
441 info
->writes_clipvertex
= TRUE
;
446 if (procType
== PIPE_SHADER_FRAGMENT
) {
448 case TGSI_SEMANTIC_POSITION
:
449 info
->writes_z
= TRUE
;
451 case TGSI_SEMANTIC_STENCIL
:
452 info
->writes_stencil
= TRUE
;
454 case TGSI_SEMANTIC_SAMPLEMASK
:
455 info
->writes_samplemask
= TRUE
;
460 if (procType
== PIPE_SHADER_VERTEX
) {
461 if (semName
== TGSI_SEMANTIC_EDGEFLAG
) {
462 info
->writes_edgeflag
= TRUE
;
465 } else if (file
== TGSI_FILE_SAMPLER
) {
466 STATIC_ASSERT(sizeof(info
->samplers_declared
) * 8 >= PIPE_MAX_SAMPLERS
);
467 info
->samplers_declared
|= 1u << reg
;
468 } else if (file
== TGSI_FILE_SAMPLER_VIEW
) {
469 unsigned target
= fulldecl
->SamplerView
.Resource
;
470 assert(target
< TGSI_TEXTURE_UNKNOWN
);
471 if (info
->sampler_targets
[reg
] == TGSI_TEXTURE_UNKNOWN
) {
472 /* Save sampler target for this sampler index */
473 info
->sampler_targets
[reg
] = target
;
475 /* if previously declared, make sure targets agree */
476 assert(info
->sampler_targets
[reg
] == target
);
478 } else if (file
== TGSI_FILE_IMAGE
) {
479 if (fulldecl
->Image
.Resource
== TGSI_TEXTURE_BUFFER
)
480 info
->images_buffers
|= 1 << reg
;
487 scan_immediate(struct tgsi_shader_info
*info
)
489 uint reg
= info
->immediate_count
++;
490 uint file
= TGSI_FILE_IMMEDIATE
;
492 info
->file_mask
[file
] |= (1 << reg
);
493 info
->file_count
[file
]++;
494 info
->file_max
[file
] = MAX2(info
->file_max
[file
], (int)reg
);
499 scan_property(struct tgsi_shader_info
*info
,
500 const struct tgsi_full_property
*fullprop
)
502 unsigned name
= fullprop
->Property
.PropertyName
;
503 unsigned value
= fullprop
->u
[0].Data
;
505 assert(name
< ARRAY_SIZE(info
->properties
));
506 info
->properties
[name
] = value
;
509 case TGSI_PROPERTY_NUM_CLIPDIST_ENABLED
:
510 info
->num_written_clipdistance
= value
;
511 info
->clipdist_writemask
|= (1 << value
) - 1;
513 case TGSI_PROPERTY_NUM_CULLDIST_ENABLED
:
514 info
->num_written_culldistance
= value
;
515 info
->culldist_writemask
|= (1 << value
) - 1;
522 * Scan the given TGSI shader to collect information such as number of
523 * registers used, special instructions used, etc.
524 * \return info the result of the scan
527 tgsi_scan_shader(const struct tgsi_token
*tokens
,
528 struct tgsi_shader_info
*info
)
531 struct tgsi_parse_context parse
;
532 unsigned current_depth
= 0;
534 memset(info
, 0, sizeof(*info
));
535 for (i
= 0; i
< TGSI_FILE_COUNT
; i
++)
536 info
->file_max
[i
] = -1;
537 for (i
= 0; i
< ARRAY_SIZE(info
->const_file_max
); i
++)
538 info
->const_file_max
[i
] = -1;
539 info
->properties
[TGSI_PROPERTY_GS_INVOCATIONS
] = 1;
540 for (i
= 0; i
< ARRAY_SIZE(info
->sampler_targets
); i
++)
541 info
->sampler_targets
[i
] = TGSI_TEXTURE_UNKNOWN
;
544 ** Setup to begin parsing input shader
546 if (tgsi_parse_init( &parse
, tokens
) != TGSI_PARSE_OK
) {
547 debug_printf("tgsi_parse_init() failed in tgsi_scan_shader()!\n");
550 procType
= parse
.FullHeader
.Processor
.Processor
;
551 assert(procType
== PIPE_SHADER_FRAGMENT
||
552 procType
== PIPE_SHADER_VERTEX
||
553 procType
== PIPE_SHADER_GEOMETRY
||
554 procType
== PIPE_SHADER_TESS_CTRL
||
555 procType
== PIPE_SHADER_TESS_EVAL
||
556 procType
== PIPE_SHADER_COMPUTE
);
557 info
->processor
= procType
;
560 ** Loop over incoming program tokens/instructions
562 while (!tgsi_parse_end_of_tokens(&parse
)) {
565 tgsi_parse_token( &parse
);
567 switch( parse
.FullToken
.Token
.Type
) {
568 case TGSI_TOKEN_TYPE_INSTRUCTION
:
569 scan_instruction(info
, &parse
.FullToken
.FullInstruction
,
572 case TGSI_TOKEN_TYPE_DECLARATION
:
573 scan_declaration(info
, &parse
.FullToken
.FullDeclaration
);
575 case TGSI_TOKEN_TYPE_IMMEDIATE
:
576 scan_immediate(info
);
578 case TGSI_TOKEN_TYPE_PROPERTY
:
579 scan_property(info
, &parse
.FullToken
.FullProperty
);
582 assert(!"Unexpected TGSI token type");
586 info
->uses_kill
= (info
->opcode_count
[TGSI_OPCODE_KILL_IF
] ||
587 info
->opcode_count
[TGSI_OPCODE_KILL
]);
589 /* The dimensions of the IN decleration in geometry shader have
590 * to be deduced from the type of the input primitive.
592 if (procType
== PIPE_SHADER_GEOMETRY
) {
593 unsigned input_primitive
=
594 info
->properties
[TGSI_PROPERTY_GS_INPUT_PRIM
];
595 int num_verts
= u_vertices_per_prim(input_primitive
);
597 info
->file_count
[TGSI_FILE_INPUT
] = num_verts
;
598 info
->file_max
[TGSI_FILE_INPUT
] =
599 MAX2(info
->file_max
[TGSI_FILE_INPUT
], num_verts
- 1);
600 for (j
= 0; j
< num_verts
; ++j
) {
601 info
->file_mask
[TGSI_FILE_INPUT
] |= (1 << j
);
605 tgsi_parse_free(&parse
);
611 * Check if the given shader is a "passthrough" shader consisting of only
612 * MOV instructions of the form: MOV OUT[n], IN[n]
616 tgsi_is_passthrough_shader(const struct tgsi_token
*tokens
)
618 struct tgsi_parse_context parse
;
621 ** Setup to begin parsing input shader
623 if (tgsi_parse_init(&parse
, tokens
) != TGSI_PARSE_OK
) {
624 debug_printf("tgsi_parse_init() failed in tgsi_is_passthrough_shader()!\n");
629 ** Loop over incoming program tokens/instructions
631 while (!tgsi_parse_end_of_tokens(&parse
)) {
633 tgsi_parse_token(&parse
);
635 switch (parse
.FullToken
.Token
.Type
) {
636 case TGSI_TOKEN_TYPE_INSTRUCTION
:
638 struct tgsi_full_instruction
*fullinst
=
639 &parse
.FullToken
.FullInstruction
;
640 const struct tgsi_full_src_register
*src
=
642 const struct tgsi_full_dst_register
*dst
=
645 /* Do a whole bunch of checks for a simple move */
646 if (fullinst
->Instruction
.Opcode
!= TGSI_OPCODE_MOV
||
647 (src
->Register
.File
!= TGSI_FILE_INPUT
&&
648 src
->Register
.File
!= TGSI_FILE_SYSTEM_VALUE
) ||
649 dst
->Register
.File
!= TGSI_FILE_OUTPUT
||
650 src
->Register
.Index
!= dst
->Register
.Index
||
652 src
->Register
.Negate
||
653 src
->Register
.Absolute
||
655 src
->Register
.SwizzleX
!= TGSI_SWIZZLE_X
||
656 src
->Register
.SwizzleY
!= TGSI_SWIZZLE_Y
||
657 src
->Register
.SwizzleZ
!= TGSI_SWIZZLE_Z
||
658 src
->Register
.SwizzleW
!= TGSI_SWIZZLE_W
||
660 dst
->Register
.WriteMask
!= TGSI_WRITEMASK_XYZW
)
662 tgsi_parse_free(&parse
);
668 case TGSI_TOKEN_TYPE_DECLARATION
:
670 case TGSI_TOKEN_TYPE_IMMEDIATE
:
672 case TGSI_TOKEN_TYPE_PROPERTY
:
679 tgsi_parse_free(&parse
);
681 /* if we get here, it's a pass-through shader */