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 **************************************************************************/
31 #include "pipe/p_shader_tokens.h"
33 #if defined __cplusplus
37 struct tgsi_full_version
39 struct tgsi_version Version
;
42 struct tgsi_full_header
44 struct tgsi_header Header
;
45 struct tgsi_processor Processor
;
48 struct tgsi_full_dst_register
50 struct tgsi_dst_register DstRegister
;
51 struct tgsi_dst_register_ext_concode DstRegisterExtConcode
;
52 struct tgsi_dst_register_ext_modulate DstRegisterExtModulate
;
55 struct tgsi_full_src_register
57 struct tgsi_src_register SrcRegister
;
58 struct tgsi_src_register_ext_swz SrcRegisterExtSwz
;
59 struct tgsi_src_register_ext_mod SrcRegisterExtMod
;
60 struct tgsi_src_register SrcRegisterInd
;
61 struct tgsi_dimension SrcRegisterDim
;
62 struct tgsi_src_register SrcRegisterDimInd
;
65 struct tgsi_full_declaration
67 struct tgsi_declaration Declaration
;
68 struct tgsi_declaration_range DeclarationRange
;
69 struct tgsi_declaration_semantic Semantic
;
72 struct tgsi_full_immediate
74 struct tgsi_immediate Immediate
;
78 const struct tgsi_immediate_float32
*ImmediateFloat32
;
82 #define TGSI_FULL_MAX_DST_REGISTERS 2
83 #define TGSI_FULL_MAX_SRC_REGISTERS 4 /* TXD has 4 */
85 struct tgsi_full_instruction
87 struct tgsi_instruction Instruction
;
88 struct tgsi_instruction_ext_nv InstructionExtNv
;
89 struct tgsi_instruction_ext_label InstructionExtLabel
;
90 struct tgsi_instruction_ext_texture InstructionExtTexture
;
91 struct tgsi_full_dst_register FullDstRegisters
[TGSI_FULL_MAX_DST_REGISTERS
];
92 struct tgsi_full_src_register FullSrcRegisters
[TGSI_FULL_MAX_SRC_REGISTERS
];
97 struct tgsi_token Token
;
98 struct tgsi_full_declaration FullDeclaration
;
99 struct tgsi_full_immediate FullImmediate
;
100 struct tgsi_full_instruction FullInstruction
;
104 tgsi_full_token_init(
105 union tgsi_full_token
*full_token
);
108 tgsi_full_token_free(
109 union tgsi_full_token
*full_token
);
111 struct tgsi_parse_context
113 const struct tgsi_token
*Tokens
;
115 struct tgsi_full_version FullVersion
;
116 struct tgsi_full_header FullHeader
;
117 union tgsi_full_token FullToken
;
120 #define TGSI_PARSE_OK 0
121 #define TGSI_PARSE_ERROR 1
125 struct tgsi_parse_context
*ctx
,
126 const struct tgsi_token
*tokens
);
130 struct tgsi_parse_context
*ctx
);
133 tgsi_parse_end_of_tokens(
134 struct tgsi_parse_context
*ctx
);
138 struct tgsi_parse_context
*ctx
);
141 tgsi_num_tokens(const struct tgsi_token
*tokens
);
144 tgsi_dup_tokens(const struct tgsi_token
*tokens
);
146 #if defined __cplusplus
150 #endif /* TGSI_PARSE_H */