OSDN Git Service

r600g: add POW instruction
[android-x86/external-mesa.git] / src / mesa / slang / slang_compile.h
1 /*
2  * Mesa 3-D graphics library
3  * Version:  6.5
4  *
5  * Copyright (C) 2005-2006  Brian Paul   All Rights Reserved.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included
15  * in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24
25 #if !defined SLANG_COMPILE_H
26 #define SLANG_COMPILE_H
27
28 #include "main/glheader.h"
29 #include "main/mtypes.h"
30 #include "slang_compile_function.h"
31 #include "slang_compile_struct.h"
32 #include "slang_compile_variable.h"
33 #include "slang_utility.h"
34
35 struct slang_code_object_;
36
37 #if defined __cplusplus
38 extern "C" {
39 #endif
40
41 typedef struct slang_name_space_
42 {
43    struct slang_function_scope_ *funcs;
44    struct slang_struct_scope_ *structs;
45    struct slang_variable_scope_ *vars;
46 } slang_name_space;
47
48 typedef enum slang_unit_type_
49 {
50    SLANG_UNIT_FRAGMENT_SHADER,
51    SLANG_UNIT_VERTEX_SHADER,
52    SLANG_UNIT_GEOMETRY_SHADER,
53    SLANG_UNIT_FRAGMENT_BUILTIN,
54    SLANG_UNIT_VERTEX_BUILTIN,
55    SLANG_UNIT_GEOMETRY_BUILTIN
56 } slang_unit_type;
57
58
59 typedef struct slang_code_unit_
60 {
61    slang_variable_scope vars;
62    slang_function_scope funs;
63    slang_struct_scope structs;
64    slang_unit_type type;
65    struct slang_code_object_ *object;
66 } slang_code_unit;
67
68
69 extern GLvoid
70 _slang_code_unit_ctr (slang_code_unit *, struct slang_code_object_ *);
71
72 extern GLvoid
73 _slang_code_unit_dtr (slang_code_unit *);
74
75 #define SLANG_BUILTIN_CORE   0
76 #define SLANG_BUILTIN_120_CORE   1
77 #define SLANG_BUILTIN_COMMON 2
78 #define SLANG_BUILTIN_TARGET 3
79
80 #define SLANG_BUILTIN_TOTAL  4
81
82 typedef struct slang_code_object_
83 {
84    slang_code_unit builtin[SLANG_BUILTIN_TOTAL];
85    slang_code_unit unit;
86    slang_atom_pool atompool;
87 } slang_code_object;
88
89 extern GLvoid
90 _slang_code_object_ctr (slang_code_object *);
91
92 extern GLvoid
93 _slang_code_object_dtr (slang_code_object *);
94
95 extern GLboolean
96 _slang_compile (GLcontext *ctx, struct gl_shader *shader);
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif
103