~ubuntu-branches/ubuntu/jaunty/mesa/jaunty

« back to all changes in this revision

Viewing changes to src/mesa/shader/slang/slang_typeinfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-01-23 10:20:24 UTC
  • mfrom: (1.2.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20090123102024-1f3kmb3aea7wzk67
Tags: 7.3~rc3-1ubuntu1
* Merge with Debian experimental.
* Drop 102_dont_vblank.patch, since the new drm code in the kernel
  fixes the bugs that it worked around.
* Bump the build-dependency of libdrm to 2.4.4. It's the first version
  with necessary changes to build this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
struct slang_operation_;
36
36
 
 
37
struct slang_name_space_;
 
38
 
 
39
 
37
40
 
38
41
/**
39
42
 * Holds complete information about vector swizzle - the <swizzle>
47
50
   GLuint swizzle[4];
48
51
} slang_swizzle;
49
52
 
50
 
typedef struct slang_name_space_
51
 
{
52
 
   struct slang_function_scope_ *funcs;
53
 
   struct slang_struct_scope_ *structs;
54
 
   struct slang_variable_scope_ *vars;
55
 
} slang_name_space;
56
 
 
57
 
 
58
 
typedef struct slang_assemble_ctx_
59
 
{
60
 
   slang_atom_pool *atoms;
61
 
   slang_name_space space;
62
 
   struct gl_program *program;
63
 
   slang_var_table *vartable;
64
 
   slang_info_log *log;
65
 
   struct slang_label_ *curFuncEndLabel;
66
 
   struct slang_ir_node_ *CurLoop;
67
 
   struct slang_function_ *CurFunction;
68
 
} slang_assemble_ctx;
69
 
 
70
 
 
71
 
extern struct slang_function_ *
72
 
_slang_locate_function(const struct slang_function_scope_ *funcs,
73
 
                       slang_atom name, struct slang_operation_ *params,
74
 
                       GLuint num_params,
75
 
                       const slang_name_space *space,
76
 
                       slang_atom_pool *atoms, slang_info_log *log,
77
 
                       GLboolean *error);
78
 
 
79
 
 
80
53
extern GLboolean
81
54
_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz);
82
55
 
83
 
extern GLboolean
84
 
_slang_is_swizzle_mask(const slang_swizzle *swz, GLuint rows);
85
 
 
86
 
extern GLvoid
87
 
_slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *,
88
 
                         const slang_swizzle *);
 
56
 
 
57
typedef enum slang_type_variant_
 
58
{
 
59
   SLANG_VARIANT,    /* the default */
 
60
   SLANG_INVARIANT   /* indicates the "invariant" keyword */
 
61
} slang_type_variant;
 
62
 
 
63
 
 
64
typedef enum slang_type_centroid_
 
65
{
 
66
   SLANG_CENTER,    /* the default */
 
67
   SLANG_CENTROID   /* indicates the "centroid" keyword */
 
68
} slang_type_centroid;
 
69
 
 
70
 
 
71
typedef enum slang_type_qualifier_
 
72
{
 
73
   SLANG_QUAL_NONE,
 
74
   SLANG_QUAL_CONST,
 
75
   SLANG_QUAL_ATTRIBUTE,
 
76
   SLANG_QUAL_VARYING,
 
77
   SLANG_QUAL_UNIFORM,
 
78
   SLANG_QUAL_OUT,
 
79
   SLANG_QUAL_INOUT,
 
80
   SLANG_QUAL_FIXEDOUTPUT,      /* internal */
 
81
   SLANG_QUAL_FIXEDINPUT        /* internal */
 
82
} slang_type_qualifier;
 
83
 
 
84
 
 
85
typedef enum slang_type_precision_
 
86
{
 
87
   SLANG_PREC_DEFAULT,
 
88
   SLANG_PREC_LOW,
 
89
   SLANG_PREC_MEDIUM,
 
90
   SLANG_PREC_HIGH
 
91
} slang_type_precision;
89
92
 
90
93
 
91
94
/**
128
131
} slang_type_specifier_type;
129
132
 
130
133
 
 
134
extern slang_type_specifier_type
 
135
slang_type_specifier_type_from_string(const char *);
 
136
 
 
137
extern const char *
 
138
slang_type_specifier_type_to_string(slang_type_specifier_type);
 
139
 
 
140
 
131
141
/**
132
142
 * Describes more sophisticated types, like structs and arrays.
133
143
 */
134
144
typedef struct slang_type_specifier_
135
145
{
136
146
   slang_type_specifier_type type;
137
 
   struct slang_struct_ *_struct;         /**< used if type == spec_struct */
138
 
   struct slang_type_specifier_ *_array;  /**< used if type == spec_array */
 
147
   struct slang_struct_ *_struct;         /**< if type == SLANG_SPEC_STRUCT */
 
148
   struct slang_type_specifier_ *_array;  /**< if type == SLANG_SPEC_ARRAY */
139
149
} slang_type_specifier;
140
150
 
141
151
 
145
155
extern GLvoid
146
156
slang_type_specifier_dtr(slang_type_specifier *);
147
157
 
 
158
extern slang_type_specifier *
 
159
slang_type_specifier_new(slang_type_specifier_type type,
 
160
                         struct slang_struct_ *_struct,
 
161
                         struct slang_type_specifier_ *_array);
 
162
 
 
163
 
148
164
extern GLboolean
149
165
slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *);
150
166
 
153
169
                           const slang_type_specifier *);
154
170
 
155
171
 
 
172
extern GLboolean
 
173
slang_type_specifier_compatible(const slang_type_specifier * x,
 
174
                                const slang_type_specifier * y);
 
175
 
 
176
 
 
177
typedef struct slang_fully_specified_type_
 
178
{
 
179
   slang_type_qualifier qualifier;
 
180
   slang_type_specifier specifier;
 
181
   slang_type_precision precision;
 
182
   slang_type_variant variant;
 
183
   slang_type_centroid centroid;
 
184
   GLint array_len;           /**< -1 if not an array type */
 
185
} slang_fully_specified_type;
 
186
 
 
187
extern int
 
188
slang_fully_specified_type_construct(slang_fully_specified_type *);
 
189
 
 
190
extern void
 
191
slang_fully_specified_type_destruct(slang_fully_specified_type *);
 
192
 
 
193
extern int
 
194
slang_fully_specified_type_copy(slang_fully_specified_type *,
 
195
                                const slang_fully_specified_type *);
 
196
 
 
197
 
 
198
 
156
199
typedef struct slang_typeinfo_
157
200
{
158
201
   GLboolean can_be_referenced;
169
212
slang_typeinfo_destruct(slang_typeinfo *);
170
213
 
171
214
 
172
 
/**
173
 
 * Retrieves type information about an operation.
174
 
 * Returns GL_TRUE on success.
175
 
 * Returns GL_FALSE otherwise.
176
 
 */
177
 
extern GLboolean
178
 
_slang_typeof_operation(const slang_assemble_ctx *,
179
 
                        struct slang_operation_ *,
180
 
                        slang_typeinfo *);
181
 
 
182
 
extern GLboolean
183
 
_slang_typeof_operation_(struct slang_operation_ *,
184
 
                         const slang_name_space *,
 
215
extern GLboolean
 
216
_slang_typeof_operation(struct slang_operation_ *,
 
217
                         const struct slang_name_space_ *,
185
218
                         slang_typeinfo *, slang_atom_pool *,
186
219
                         slang_info_log *log);
187
220