_slang_evaluate_int() no longer used
[mesa.git] / src / mesa / shader / slang / slang_compile.h
index 8c7b96c97024fb4edf9f3851b9d9907a72e1e1e3..a8311e854652e250b2c4a854d2de962a02d3021f 100644 (file)
  */
 
 #if !defined SLANG_COMPILE_H
-#define SLANG_COMPILE_H\r
-\r
-#include "slang_compile_variable.h"\r
-#include "slang_compile_struct.h"\r
-#include "slang_compile_operation.h"\r
+#define SLANG_COMPILE_H
+
+#include "imports.h"
+#include "mtypes.h"
+#include "slang_export.h"
+#include "slang_execute.h"
+#include "slang_compile_variable.h"
+#include "slang_compile_struct.h"
+#include "slang_compile_operation.h"
 #include "slang_compile_function.h"
 
 #if defined __cplusplus
@@ -40,33 +44,56 @@ typedef enum slang_unit_type_
        slang_unit_vertex_shader,
        slang_unit_fragment_builtin,
        slang_unit_vertex_builtin
-} slang_unit_type;\r
-\r
-typedef struct slang_var_pool_\r
-{\r
-       GLuint next_addr;\r
-} slang_var_pool;\r
-\r
-typedef struct slang_translation_unit_
+} slang_unit_type;
+
+typedef struct slang_var_pool_
+{
+       GLuint next_addr;
+} slang_var_pool;
+
+typedef struct slang_code_unit_
 {
-       slang_variable_scope globals;
-       slang_function_scope functions;
-       slang_struct_scope structs;
-       slang_unit_type type;\r
-       struct slang_assembly_file_ *assembly;\r
-       int free_assembly;\r
-       slang_var_pool *global_pool;\r
-       int free_global_pool;\r
-       struct slang_machine_ *machine;\r
-       int free_machine;\r
-       slang_atom_pool *atom_pool;\r
-       int free_atom_pool;
-} slang_translation_unit;
-
-int slang_translation_unit_construct (slang_translation_unit *);\r
-int slang_translation_unit_construct2 (slang_translation_unit *, struct slang_assembly_file_ *,\r
-       slang_var_pool *, struct slang_machine_ *, slang_atom_pool *);
-void slang_translation_unit_destruct (slang_translation_unit *);
+   slang_variable_scope vars;
+   slang_function_scope funs;
+   slang_struct_scope structs;
+   slang_unit_type type;
+   struct slang_code_object_ *object;
+} slang_code_unit;
+
+extern GLvoid
+_slang_code_unit_ctr (slang_code_unit *, struct slang_code_object_ *);
+
+extern GLvoid
+_slang_code_unit_dtr (slang_code_unit *);
+
+#define SLANG_BUILTIN_CORE   0
+#define SLANG_BUILTIN_COMMON 1
+#define SLANG_BUILTIN_TARGET 2
+
+#if 0/*defined(USE_X86_ASM) || defined(SLANG_X86)*/
+#define SLANG_BUILTIN_VEC4   3
+#define SLANG_BUILTIN_TOTAL  4
+#else
+#define SLANG_BUILTIN_TOTAL  3
+#endif
+
+typedef struct slang_code_object_
+{
+   slang_code_unit builtin[SLANG_BUILTIN_TOTAL];
+   slang_code_unit unit;
+   slang_assembly_file assembly;
+   slang_machine machine;
+   slang_var_pool varpool;
+   slang_atom_pool atompool;
+   slang_export_data_table expdata;
+   slang_export_code_table expcode;
+} slang_code_object;
+
+extern GLvoid
+_slang_code_object_ctr (slang_code_object *);
+
+extern GLvoid
+_slang_code_object_dtr (slang_code_object *);
 
 typedef struct slang_info_log_
 {
@@ -76,11 +103,13 @@ typedef struct slang_info_log_
 
 void slang_info_log_construct (slang_info_log *);
 void slang_info_log_destruct (slang_info_log *);
+int slang_info_log_print (slang_info_log *, const char *, ...);
 int slang_info_log_error (slang_info_log *, const char *, ...);
 int slang_info_log_warning (slang_info_log *, const char *, ...);
 void slang_info_log_memory (slang_info_log *);
 
-int _slang_compile (const char *, slang_translation_unit *, slang_unit_type type, slang_info_log *);
+extern GLboolean
+_slang_compile (GLcontext *ctx, struct gl_shader *shader);
 
 #ifdef __cplusplus
 }