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
< Elements(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 semName
== TGSI_SEMANTIC_CULLDIST
) {
341 switch (fulldecl
->Interp
.Interpolate
) {
342 case TGSI_INTERPOLATE_COLOR
:
343 case TGSI_INTERPOLATE_PERSPECTIVE
:
344 switch (fulldecl
->Interp
.Location
) {
345 case TGSI_INTERPOLATE_LOC_CENTER
:
346 info
->uses_persp_center
= TRUE
;
348 case TGSI_INTERPOLATE_LOC_CENTROID
:
349 info
->uses_persp_centroid
= TRUE
;
351 case TGSI_INTERPOLATE_LOC_SAMPLE
:
352 info
->uses_persp_sample
= TRUE
;
356 case TGSI_INTERPOLATE_LINEAR
:
357 switch (fulldecl
->Interp
.Location
) {
358 case TGSI_INTERPOLATE_LOC_CENTER
:
359 info
->uses_linear_center
= TRUE
;
361 case TGSI_INTERPOLATE_LOC_CENTROID
:
362 info
->uses_linear_centroid
= TRUE
;
364 case TGSI_INTERPOLATE_LOC_SAMPLE
:
365 info
->uses_linear_sample
= TRUE
;
369 /* TGSI_INTERPOLATE_CONSTANT doesn't do any interpolation. */
373 if (semName
== TGSI_SEMANTIC_PRIMID
)
374 info
->uses_primid
= TRUE
;
375 else if (procType
== PIPE_SHADER_FRAGMENT
) {
376 if (semName
== TGSI_SEMANTIC_POSITION
)
377 info
->reads_position
= TRUE
;
378 else if (semName
== TGSI_SEMANTIC_FACE
)
379 info
->uses_frontface
= TRUE
;
382 else if (file
== TGSI_FILE_SYSTEM_VALUE
) {
383 unsigned index
= fulldecl
->Range
.First
;
385 info
->system_value_semantic_name
[index
] = semName
;
386 info
->num_system_values
= MAX2(info
->num_system_values
, index
+ 1);
389 case TGSI_SEMANTIC_INSTANCEID
:
390 info
->uses_instanceid
= TRUE
;
392 case TGSI_SEMANTIC_VERTEXID
:
393 info
->uses_vertexid
= TRUE
;
395 case TGSI_SEMANTIC_VERTEXID_NOBASE
:
396 info
->uses_vertexid_nobase
= TRUE
;
398 case TGSI_SEMANTIC_BASEVERTEX
:
399 info
->uses_basevertex
= TRUE
;
401 case TGSI_SEMANTIC_PRIMID
:
402 info
->uses_primid
= TRUE
;
404 case TGSI_SEMANTIC_INVOCATIONID
:
405 info
->uses_invocationid
= TRUE
;
407 case TGSI_SEMANTIC_POSITION
:
408 info
->reads_position
= TRUE
;
410 case TGSI_SEMANTIC_FACE
:
411 info
->uses_frontface
= TRUE
;
413 case TGSI_SEMANTIC_SAMPLEMASK
:
414 info
->reads_samplemask
= TRUE
;
418 else if (file
== TGSI_FILE_OUTPUT
) {
419 info
->output_semantic_name
[reg
] = (ubyte
) semName
;
420 info
->output_semantic_index
[reg
] = (ubyte
) semIndex
;
422 assert(reg
< info
->num_outputs
);
424 if (semName
== TGSI_SEMANTIC_COLOR
)
425 info
->colors_written
|= 1 << semIndex
;
427 if (procType
== PIPE_SHADER_VERTEX
||
428 procType
== PIPE_SHADER_GEOMETRY
||
429 procType
== PIPE_SHADER_TESS_CTRL
||
430 procType
== PIPE_SHADER_TESS_EVAL
) {
432 case TGSI_SEMANTIC_VIEWPORT_INDEX
:
433 info
->writes_viewport_index
= TRUE
;
435 case TGSI_SEMANTIC_LAYER
:
436 info
->writes_layer
= TRUE
;
438 case TGSI_SEMANTIC_PSIZE
:
439 info
->writes_psize
= TRUE
;
441 case TGSI_SEMANTIC_CLIPVERTEX
:
442 info
->writes_clipvertex
= TRUE
;
447 if (procType
== PIPE_SHADER_FRAGMENT
) {
449 case TGSI_SEMANTIC_POSITION
:
450 info
->writes_z
= TRUE
;
452 case TGSI_SEMANTIC_STENCIL
:
453 info
->writes_stencil
= TRUE
;
455 case TGSI_SEMANTIC_SAMPLEMASK
:
456 info
->writes_samplemask
= TRUE
;
461 if (procType
== PIPE_SHADER_VERTEX
) {
462 if (semName
== TGSI_SEMANTIC_EDGEFLAG
) {
463 info
->writes_edgeflag
= TRUE
;
466 } else if (file
== TGSI_FILE_SAMPLER
) {
467 STATIC_ASSERT(sizeof(info
->samplers_declared
) * 8 >= PIPE_MAX_SAMPLERS
);
468 info
->samplers_declared
|= 1u << reg
;
469 } else if (file
== TGSI_FILE_SAMPLER_VIEW
) {
470 unsigned target
= fulldecl
->SamplerView
.Resource
;
471 assert(target
< TGSI_TEXTURE_UNKNOWN
);
472 if (info
->sampler_targets
[reg
] == TGSI_TEXTURE_UNKNOWN
) {
473 /* Save sampler target for this sampler index */
474 info
->sampler_targets
[reg
] = target
;
476 /* if previously declared, make sure targets agree */
477 assert(info
->sampler_targets
[reg
] == target
);
479 } else if (file
== TGSI_FILE_IMAGE
) {
480 if (fulldecl
->Image
.Resource
== TGSI_TEXTURE_BUFFER
)
481 info
->images_buffers
|= 1 << reg
;
488 scan_immediate(struct tgsi_shader_info
*info
)
490 uint reg
= info
->immediate_count
++;
491 uint file
= TGSI_FILE_IMMEDIATE
;
493 info
->file_mask
[file
] |= (1 << reg
);
494 info
->file_count
[file
]++;
495 info
->file_max
[file
] = MAX2(info
->file_max
[file
], (int)reg
);
500 scan_property(struct tgsi_shader_info
*info
,
501 const struct tgsi_full_property
*fullprop
)
503 unsigned name
= fullprop
->Property
.PropertyName
;
504 unsigned value
= fullprop
->u
[0].Data
;
506 assert(name
< Elements(info
->properties
));
507 info
->properties
[name
] = value
;
510 case TGSI_PROPERTY_NUM_CLIPDIST_ENABLED
:
511 info
->num_written_clipdistance
= value
;
512 info
->clipdist_writemask
|= (1 << value
) - 1;
514 case TGSI_PROPERTY_NUM_CULLDIST_ENABLED
:
515 info
->num_written_culldistance
= value
;
516 info
->culldist_writemask
|= (1 << value
) - 1;
523 * Scan the given TGSI shader to collect information such as number of
524 * registers used, special instructions used, etc.
525 * \return info the result of the scan
528 tgsi_scan_shader(const struct tgsi_token
*tokens
,
529 struct tgsi_shader_info
*info
)
532 struct tgsi_parse_context parse
;
533 unsigned current_depth
= 0;
535 memset(info
, 0, sizeof(*info
));
536 for (i
= 0; i
< TGSI_FILE_COUNT
; i
++)
537 info
->file_max
[i
] = -1;
538 for (i
= 0; i
< Elements(info
->const_file_max
); i
++)
539 info
->const_file_max
[i
] = -1;
540 info
->properties
[TGSI_PROPERTY_GS_INVOCATIONS
] = 1;
541 for (i
= 0; i
< Elements(info
->sampler_targets
); i
++)
542 info
->sampler_targets
[i
] = TGSI_TEXTURE_UNKNOWN
;
545 ** Setup to begin parsing input shader
547 if (tgsi_parse_init( &parse
, tokens
) != TGSI_PARSE_OK
) {
548 debug_printf("tgsi_parse_init() failed in tgsi_scan_shader()!\n");
551 procType
= parse
.FullHeader
.Processor
.Processor
;
552 assert(procType
== PIPE_SHADER_FRAGMENT
||
553 procType
== PIPE_SHADER_VERTEX
||
554 procType
== PIPE_SHADER_GEOMETRY
||
555 procType
== PIPE_SHADER_TESS_CTRL
||
556 procType
== PIPE_SHADER_TESS_EVAL
||
557 procType
== PIPE_SHADER_COMPUTE
);
558 info
->processor
= procType
;
561 ** Loop over incoming program tokens/instructions
563 while (!tgsi_parse_end_of_tokens(&parse
)) {
566 tgsi_parse_token( &parse
);
568 switch( parse
.FullToken
.Token
.Type
) {
569 case TGSI_TOKEN_TYPE_INSTRUCTION
:
570 scan_instruction(info
, &parse
.FullToken
.FullInstruction
,
573 case TGSI_TOKEN_TYPE_DECLARATION
:
574 scan_declaration(info
, &parse
.FullToken
.FullDeclaration
);
576 case TGSI_TOKEN_TYPE_IMMEDIATE
:
577 scan_immediate(info
);
579 case TGSI_TOKEN_TYPE_PROPERTY
:
580 scan_property(info
, &parse
.FullToken
.FullProperty
);
583 assert(!"Unexpected TGSI token type");
587 info
->uses_kill
= (info
->opcode_count
[TGSI_OPCODE_KILL_IF
] ||
588 info
->opcode_count
[TGSI_OPCODE_KILL
]);
590 /* The dimensions of the IN decleration in geometry shader have
591 * to be deduced from the type of the input primitive.
593 if (procType
== PIPE_SHADER_GEOMETRY
) {
594 unsigned input_primitive
=
595 info
->properties
[TGSI_PROPERTY_GS_INPUT_PRIM
];
596 int num_verts
= u_vertices_per_prim(input_primitive
);
598 info
->file_count
[TGSI_FILE_INPUT
] = num_verts
;
599 info
->file_max
[TGSI_FILE_INPUT
] =
600 MAX2(info
->file_max
[TGSI_FILE_INPUT
], num_verts
- 1);
601 for (j
= 0; j
< num_verts
; ++j
) {
602 info
->file_mask
[TGSI_FILE_INPUT
] |= (1 << j
);
606 tgsi_parse_free(&parse
);
612 * Check if the given shader is a "passthrough" shader consisting of only
613 * MOV instructions of the form: MOV OUT[n], IN[n]
617 tgsi_is_passthrough_shader(const struct tgsi_token
*tokens
)
619 struct tgsi_parse_context parse
;
622 ** Setup to begin parsing input shader
624 if (tgsi_parse_init(&parse
, tokens
) != TGSI_PARSE_OK
) {
625 debug_printf("tgsi_parse_init() failed in tgsi_is_passthrough_shader()!\n");
630 ** Loop over incoming program tokens/instructions
632 while (!tgsi_parse_end_of_tokens(&parse
)) {
634 tgsi_parse_token(&parse
);
636 switch (parse
.FullToken
.Token
.Type
) {
637 case TGSI_TOKEN_TYPE_INSTRUCTION
:
639 struct tgsi_full_instruction
*fullinst
=
640 &parse
.FullToken
.FullInstruction
;
641 const struct tgsi_full_src_register
*src
=
643 const struct tgsi_full_dst_register
*dst
=
646 /* Do a whole bunch of checks for a simple move */
647 if (fullinst
->Instruction
.Opcode
!= TGSI_OPCODE_MOV
||
648 (src
->Register
.File
!= TGSI_FILE_INPUT
&&
649 src
->Register
.File
!= TGSI_FILE_SYSTEM_VALUE
) ||
650 dst
->Register
.File
!= TGSI_FILE_OUTPUT
||
651 src
->Register
.Index
!= dst
->Register
.Index
||
653 src
->Register
.Negate
||
654 src
->Register
.Absolute
||
656 src
->Register
.SwizzleX
!= TGSI_SWIZZLE_X
||
657 src
->Register
.SwizzleY
!= TGSI_SWIZZLE_Y
||
658 src
->Register
.SwizzleZ
!= TGSI_SWIZZLE_Z
||
659 src
->Register
.SwizzleW
!= TGSI_SWIZZLE_W
||
661 dst
->Register
.WriteMask
!= TGSI_WRITEMASK_XYZW
)
663 tgsi_parse_free(&parse
);
669 case TGSI_TOKEN_TYPE_DECLARATION
:
671 case TGSI_TOKEN_TYPE_IMMEDIATE
:
673 case TGSI_TOKEN_TYPE_PROPERTY
:
680 tgsi_parse_free(&parse
);
682 /* if we get here, it's a pass-through shader */