i965: Create new files for HS/DS/TE state upload code.
[mesa.git] / src / glsl / glsl_symbol_table.h
index 39b84e4dd896092fef36b37504d7b249863955c7..5d654e5e6a778eed89357bb2c6266247d295deb5 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #include "ir.h"
 
 class symbol_table_entry;
-class glsl_type;
+struct glsl_type;
 
 /**
  * Facade class for _mesa_symbol_table
@@ -43,37 +43,8 @@ class glsl_type;
  * type safe and some symbol table invariants.
  */
 struct glsl_symbol_table {
-private:
-   static void
-   _glsl_symbol_table_destructor (glsl_symbol_table *table)
-   {
-      table->~glsl_symbol_table();
-   }
-
-public:
-   /* Callers of this ralloc-based new need not call delete. It's
-    * easier to just ralloc_free 'ctx' (or any of its ancestors). */
-   static void* operator new(size_t size, void *ctx)
-   {
-      void *table;
-
-      table = ralloc_size(ctx, size);
-      assert(table != NULL);
-
-      ralloc_set_destructor(table, (void (*)(void*)) _glsl_symbol_table_destructor);
-
-      return table;
-   }
-
-   /* If the user *does* call delete, that's OK, we will just
-    * ralloc_free in that case. Here, C++ will have already called the
-    * destructor so tell ralloc not to do that again. */
-   static void operator delete(void *table)
-   {
-      ralloc_set_destructor(table, NULL);
-      ralloc_free(table);
-   }
-   
+   DECLARE_RALLOC_CXX_OPERATORS(glsl_symbol_table)
+
    glsl_symbol_table();
    ~glsl_symbol_table();
 
@@ -101,6 +72,7 @@ public:
    bool add_function(ir_function *f);
    bool add_interface(const char *name, const glsl_type *i,
                       enum ir_variable_mode mode);
+   bool add_default_precision_qualifier(const char *type_name, int precision);
    /*@}*/
 
    /**
@@ -117,6 +89,7 @@ public:
    ir_function *get_function(const char *name);
    const glsl_type *get_interface(const char *name,
                                   enum ir_variable_mode mode);
+   int get_default_precision_qualifier(const char *type_name);
    /*@}*/
 
    /**