~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Mesa 3-D graphics library
3
 
 * Version:  6.5
 
3
 * Version:  6.5.2
4
4
 *
5
5
 * Copyright (C) 2005-2006  Brian Paul   All Rights Reserved.
6
6
 *
22
22
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 */
24
24
 
25
 
#if !defined SLANG_COMPILE_VARIABLE_H
 
25
#ifndef SLANG_COMPILE_VARIABLE_H
26
26
#define SLANG_COMPILE_VARIABLE_H
27
27
 
28
28
#if defined __cplusplus
29
29
extern "C" {
30
30
#endif
31
31
 
 
32
 
32
33
typedef enum slang_type_qualifier_
33
34
{
34
 
        slang_qual_none,
35
 
        slang_qual_const,
36
 
        slang_qual_attribute,
37
 
        slang_qual_varying,
38
 
        slang_qual_uniform,
39
 
        slang_qual_out,
40
 
        slang_qual_inout,
41
 
        slang_qual_fixedoutput, /* internal */
42
 
        slang_qual_fixedinput   /* internal */
 
35
   slang_qual_none,
 
36
   slang_qual_const,
 
37
   slang_qual_attribute,
 
38
   slang_qual_varying,
 
39
   slang_qual_uniform,
 
40
   slang_qual_out,
 
41
   slang_qual_inout,
 
42
   slang_qual_fixedoutput,      /* internal */
 
43
   slang_qual_fixedinput        /* internal */
43
44
} slang_type_qualifier;
44
45
 
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 *);
 
48
 
 
49
extern const char *
 
50
slang_type_specifier_type_to_string(slang_type_specifier_type);
 
51
 
 
52
 
47
53
 
48
54
typedef struct slang_fully_specified_type_
49
55
{
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;
53
59
 
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 *);
57
 
 
 
60
extern int
 
61
slang_fully_specified_type_construct(slang_fully_specified_type *);
 
62
 
 
63
extern void
 
64
slang_fully_specified_type_destruct(slang_fully_specified_type *);
 
65
 
 
66
extern int
 
67
slang_fully_specified_type_copy(slang_fully_specified_type *,
 
68
                                const slang_fully_specified_type *);
 
69
 
 
70
 
 
71
/**
 
72
 * A shading language program variable.
 
73
 */
 
74
typedef struct slang_variable_
 
75
{
 
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 */
 
85
} slang_variable;
 
86
 
 
87
 
 
88
/**
 
89
 * Basically a list of variables, with a pointer to the parent scope.
 
90
 */
58
91
typedef struct slang_variable_scope_
59
92
{
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;
64
97
 
65
98
extern GLvoid
66
 
_slang_variable_scope_ctr (slang_variable_scope *);
67
 
 
68
 
void slang_variable_scope_destruct (slang_variable_scope *);
69
 
int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);
70
 
 
71
 
typedef struct slang_variable_
72
 
{
73
 
        slang_fully_specified_type type;
74
 
        slang_atom a_name;
75
 
        GLuint array_len;                                       /* type: spec_array */
76
 
        struct slang_operation_ *initializer;
77
 
        unsigned int address;
78
 
        unsigned int size;
79
 
        int global;
80
 
} slang_variable;
81
 
 
82
 
int slang_variable_construct (slang_variable *);
83
 
void slang_variable_destruct (slang_variable *);
84
 
int slang_variable_copy (slang_variable *, const slang_variable *);
85
 
 
86
 
slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);
87
 
 
88
 
GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);
 
99
_slang_variable_scope_ctr(slang_variable_scope *);
 
100
 
 
101
extern void
 
102
slang_variable_scope_destruct(slang_variable_scope *);
 
103
 
 
104
extern int
 
105
slang_variable_scope_copy(slang_variable_scope *,
 
106
                          const slang_variable_scope *);
 
107
 
 
108
slang_variable *
 
109
slang_variable_scope_grow(slang_variable_scope *);
 
110
 
 
111
extern int
 
112
slang_variable_construct(slang_variable *);
 
113
 
 
114
extern void
 
115
slang_variable_destruct(slang_variable *);
 
116
 
 
117
extern int
 
118
slang_variable_copy(slang_variable *, const slang_variable *);
 
119
 
 
120
extern slang_variable *
 
121
_slang_locate_variable(const slang_variable_scope *, const slang_atom a_name,
 
122
                       GLboolean all);
 
123
 
 
124
extern GLboolean
 
125
_slang_build_export_data_table(slang_export_data_table *,
 
126
                               slang_variable_scope *);
 
127
 
 
128
 
89
129
 
90
130
#ifdef __cplusplus
91
131
}
92
132
#endif
93
133
 
94
 
#endif
95
 
 
 
134
#endif /* SLANG_COMPILE_VARIABLE_H */