nv40: fix typo in one of the previous commits
[mesa.git] / src / gallium / auxiliary / tgsi / util / tgsi_parse.h
1 #if !defined TGSI_PARSE_H
2 #define TGSI_PARSE_H
3
4 #include "pipe/p_shader_tokens.h"
5
6 #if defined __cplusplus
7 extern "C" {
8 #endif
9
10 struct tgsi_full_version
11 {
12 struct tgsi_version Version;
13 };
14
15 struct tgsi_full_header
16 {
17 struct tgsi_header Header;
18 struct tgsi_processor Processor;
19 };
20
21 struct tgsi_full_dst_register
22 {
23 struct tgsi_dst_register DstRegister;
24 struct tgsi_dst_register_ext_concode DstRegisterExtConcode;
25 struct tgsi_dst_register_ext_modulate DstRegisterExtModulate;
26 };
27
28 struct tgsi_full_src_register
29 {
30 struct tgsi_src_register SrcRegister;
31 struct tgsi_src_register_ext_swz SrcRegisterExtSwz;
32 struct tgsi_src_register_ext_mod SrcRegisterExtMod;
33 struct tgsi_src_register SrcRegisterInd;
34 struct tgsi_dimension SrcRegisterDim;
35 struct tgsi_src_register SrcRegisterDimInd;
36 };
37
38 struct tgsi_full_declaration
39 {
40 struct tgsi_declaration Declaration;
41 union
42 {
43 struct tgsi_declaration_range DeclarationRange;
44 struct tgsi_declaration_mask DeclarationMask;
45 } u;
46 struct tgsi_declaration_interpolation Interpolation;
47 struct tgsi_declaration_semantic Semantic;
48 };
49
50 struct tgsi_full_immediate
51 {
52 struct tgsi_immediate Immediate;
53 union
54 {
55 const void *Pointer;
56 const struct tgsi_immediate_float32 *ImmediateFloat32;
57 } u;
58 };
59
60 #define TGSI_FULL_MAX_DST_REGISTERS 2
61 #define TGSI_FULL_MAX_SRC_REGISTERS 4 /* TXD has 4 */
62
63 struct tgsi_full_instruction
64 {
65 struct tgsi_instruction Instruction;
66 struct tgsi_instruction_ext_nv InstructionExtNv;
67 struct tgsi_instruction_ext_label InstructionExtLabel;
68 struct tgsi_instruction_ext_texture InstructionExtTexture;
69 struct tgsi_full_dst_register FullDstRegisters[TGSI_FULL_MAX_DST_REGISTERS];
70 struct tgsi_full_src_register FullSrcRegisters[TGSI_FULL_MAX_SRC_REGISTERS];
71 };
72
73 union tgsi_full_token
74 {
75 struct tgsi_token Token;
76 struct tgsi_full_declaration FullDeclaration;
77 struct tgsi_full_immediate FullImmediate;
78 struct tgsi_full_instruction FullInstruction;
79 };
80
81 void
82 tgsi_full_token_init(
83 union tgsi_full_token *full_token );
84
85 void
86 tgsi_full_token_free(
87 union tgsi_full_token *full_token );
88
89 struct tgsi_parse_context
90 {
91 const struct tgsi_token *Tokens;
92 unsigned Position;
93 struct tgsi_full_version FullVersion;
94 struct tgsi_full_header FullHeader;
95 union tgsi_full_token FullToken;
96 };
97
98 #define TGSI_PARSE_OK 0
99 #define TGSI_PARSE_ERROR 1
100
101 unsigned
102 tgsi_parse_init(
103 struct tgsi_parse_context *ctx,
104 const struct tgsi_token *tokens );
105
106 void
107 tgsi_parse_free(
108 struct tgsi_parse_context *ctx );
109
110 boolean
111 tgsi_parse_end_of_tokens(
112 struct tgsi_parse_context *ctx );
113
114 void
115 tgsi_parse_token(
116 struct tgsi_parse_context *ctx );
117
118 unsigned
119 tgsi_num_tokens(const struct tgsi_token *tokens);
120
121
122 #if defined __cplusplus
123 }
124 #endif
125
126 #endif /* TGSI_PARSE_H */
127