aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_symbol_table.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-07-12 08:22:55 +0200
committermarha <marha@users.sourceforge.net>2013-07-12 08:22:55 +0200
commitffce4319c2fb6f4f663cc5a9660e1d5837fcde87 (patch)
tree603d92313dadf957fbaba55afa634de25d3bbd96 /mesalib/src/glsl/glsl_symbol_table.cpp
parentc6069c33e3a4a6d48aa059dbe9a78702dabff9cc (diff)
downloadvcxsrv-ffce4319c2fb6f4f663cc5a9660e1d5837fcde87.tar.gz
vcxsrv-ffce4319c2fb6f4f663cc5a9660e1d5837fcde87.tar.bz2
vcxsrv-ffce4319c2fb6f4f663cc5a9660e1d5837fcde87.zip
libxtrans fontconfig mesa xserver git update 12 Jul 2013
xserver commit 59a6d3f1eb03010ab831b32b03706a1d6143c732 libxtrans commit f6a161f2a003f4da0a2e414b4faa0ee0de0c01f0 fontconfig commit 338ffe6b886ad4ba86ff471cb59c4a5e5ffbe408 mesa commit 1b0d6aef03161eff4c9933548e964fec1258ea44
Diffstat (limited to 'mesalib/src/glsl/glsl_symbol_table.cpp')
-rw-r--r--mesalib/src/glsl/glsl_symbol_table.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/mesalib/src/glsl/glsl_symbol_table.cpp b/mesalib/src/glsl/glsl_symbol_table.cpp
index 50bf11302..0bea5364e 100644
--- a/mesalib/src/glsl/glsl_symbol_table.cpp
+++ b/mesalib/src/glsl/glsl_symbol_table.cpp
@@ -84,17 +84,19 @@ public:
}
symbol_table_entry(ir_variable *v) :
- v(v), f(0), t(0), ibu(0), ibi(0), ibo(0) {}
+ v(v), f(0), t(0), ibu(0), ibi(0), ibo(0), a(0) {}
symbol_table_entry(ir_function *f) :
- v(0), f(f), t(0), ibu(0), ibi(0), ibo(0) {}
+ v(0), f(f), t(0), ibu(0), ibi(0), ibo(0), a(0) {}
symbol_table_entry(const glsl_type *t) :
- v(0), f(0), t(t), ibu(0), ibi(0), ibo(0) {}
+ v(0), f(0), t(t), ibu(0), ibi(0), ibo(0), a(0) {}
symbol_table_entry(const glsl_type *t, enum ir_variable_mode mode) :
- v(0), f(0), t(0), ibu(0), ibi(0), ibo(0)
+ v(0), f(0), t(0), ibu(0), ibi(0), ibo(0), a(0)
{
assert(t->is_interface());
add_interface(t, mode);
}
+ symbol_table_entry(const class ast_type_specifier *a):
+ v(0), f(0), t(0), ibu(0), ibi(0), ibo(0), a(a) {}
ir_variable *v;
ir_function *f;
@@ -102,6 +104,7 @@ public:
const glsl_type *ibu;
const glsl_type *ibi;
const glsl_type *ibo;
+ const class ast_type_specifier *a;
};
glsl_symbol_table::glsl_symbol_table()
@@ -172,6 +175,15 @@ bool glsl_symbol_table::add_type(const char *name, const glsl_type *t)
return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
}
+bool glsl_symbol_table::add_type_ast(const char *name, const class ast_type_specifier *a)
+{
+ symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(a);
+ char ast_name[strlen("#ast.") + strlen(name) + 1];
+ strcpy(ast_name, "#ast.");
+ strcat(ast_name + strlen("#ast."), name);
+ return _mesa_symbol_table_add_symbol(table, -1, ast_name, entry) == 0;
+}
+
bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i,
enum ir_variable_mode mode)
{
@@ -223,6 +235,15 @@ const glsl_type *glsl_symbol_table::get_type(const char *name)
return entry != NULL ? entry->t : NULL;
}
+const class ast_type_specifier *glsl_symbol_table::get_type_ast(const char *name)
+{
+ char ast_name[strlen("#ast.") + strlen(name) + 1];
+ strcpy(ast_name, "#ast.");
+ strcat(ast_name + strlen("#ast."), name);
+ symbol_table_entry *entry = get_entry(ast_name);
+ return entry != NULL ? entry->a : NULL;
+}
+
const glsl_type *glsl_symbol_table::get_interface(const char *name,
enum ir_variable_mode mode)
{