22
22
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
#if !defined SLANG_COMPILE_VARIABLE_H
25
#ifndef SLANG_COMPILE_VARIABLE_H
26
26
#define SLANG_COMPILE_VARIABLE_H
28
28
#if defined __cplusplus
32
33
typedef enum slang_type_qualifier_
41
slang_qual_fixedoutput, /* internal */
42
slang_qual_fixedinput /* internal */
42
slang_qual_fixedoutput, /* internal */
43
slang_qual_fixedinput /* internal */
43
44
} slang_type_qualifier;
45
slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
46
const char *slang_type_specifier_type_to_string (slang_type_specifier_type);
46
extern slang_type_specifier_type
47
slang_type_specifier_type_from_string(const char *);
50
slang_type_specifier_type_to_string(slang_type_specifier_type);
48
54
typedef struct slang_fully_specified_type_
50
slang_type_qualifier qualifier;
51
slang_type_specifier specifier;
56
slang_type_qualifier qualifier;
57
slang_type_specifier specifier;
52
58
} slang_fully_specified_type;
54
int slang_fully_specified_type_construct (slang_fully_specified_type *);
55
void slang_fully_specified_type_destruct (slang_fully_specified_type *);
56
int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *);
61
slang_fully_specified_type_construct(slang_fully_specified_type *);
64
slang_fully_specified_type_destruct(slang_fully_specified_type *);
67
slang_fully_specified_type_copy(slang_fully_specified_type *,
68
const slang_fully_specified_type *);
72
* A shading language program variable.
74
typedef struct slang_variable_
76
slang_fully_specified_type type; /**< Variable's data type */
77
slang_atom a_name; /**< The variable's name (char *) */
78
GLuint array_len; /**< only if type == slang_spec_array */
79
struct slang_operation_ *initializer; /**< Optional initializer code */
80
GLuint address; /**< Storage location */
81
GLuint address2; /**< Storage location */
82
GLuint size; /**< Variable's size in bytes */
83
GLboolean global; /**< A global var? */
84
void *aux; /**< Used during code gen */
89
* Basically a list of variables, with a pointer to the parent scope.
58
91
typedef struct slang_variable_scope_
60
struct slang_variable_ *variables;
93
slang_variable *variables; /**< Array [num_variables] */
61
94
GLuint num_variables;
62
struct slang_variable_scope_ *outer_scope;
95
struct slang_variable_scope_ *outer_scope;
63
96
} slang_variable_scope;
66
_slang_variable_scope_ctr (slang_variable_scope *);
68
void slang_variable_scope_destruct (slang_variable_scope *);
69
int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);
71
typedef struct slang_variable_
73
slang_fully_specified_type type;
75
GLuint array_len; /* type: spec_array */
76
struct slang_operation_ *initializer;
82
int slang_variable_construct (slang_variable *);
83
void slang_variable_destruct (slang_variable *);
84
int slang_variable_copy (slang_variable *, const slang_variable *);
86
slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);
88
GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);
99
_slang_variable_scope_ctr(slang_variable_scope *);
102
slang_variable_scope_destruct(slang_variable_scope *);
105
slang_variable_scope_copy(slang_variable_scope *,
106
const slang_variable_scope *);
109
slang_variable_scope_grow(slang_variable_scope *);
112
slang_variable_construct(slang_variable *);
115
slang_variable_destruct(slang_variable *);
118
slang_variable_copy(slang_variable *, const slang_variable *);
120
extern slang_variable *
121
_slang_locate_variable(const slang_variable_scope *, const slang_atom a_name,
125
_slang_build_export_data_table(slang_export_data_table *,
126
slang_variable_scope *);
90
130
#ifdef __cplusplus
134
#endif /* SLANG_COMPILE_VARIABLE_H */