diff options
author | Kenneth Graunke <[email protected]> | 2010-12-06 10:54:21 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-12-06 13:43:22 -0800 |
commit | c17c7903871b031162e41d6495a1bef64844e19b (patch) | |
tree | d3a89af48859453542f8e44f2fcc8c78a19c248e /src/glsl/glsl_symbol_table.cpp | |
parent | a8f52647b045b5400ebcfc58ba235599a6e9ad87 (diff) |
glsl: Properly add functions during lazy built-in prototype importing.
The original lazy built-in importing patch did not add the newly created
function to the symbol table, nor actually emit it into the IR stream.
Adding it to the symbol table is non-trivial since importing occurs when
generating some ir_call in a nested scope. A new add_global_function
method, backed by new symbol_table code in the previous patch, handles
this.
Fixes bug #32030.
Diffstat (limited to 'src/glsl/glsl_symbol_table.cpp')
-rw-r--r-- | src/glsl/glsl_symbol_table.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/glsl_symbol_table.cpp b/src/glsl/glsl_symbol_table.cpp index fb22a17ce58..3dcd928016a 100644 --- a/src/glsl/glsl_symbol_table.cpp +++ b/src/glsl/glsl_symbol_table.cpp @@ -135,6 +135,13 @@ bool glsl_symbol_table::add_function(ir_function *f) return _mesa_symbol_table_add_symbol(table, -1, f->name, entry) == 0; } +void glsl_symbol_table::add_global_function(ir_function *f) +{ + symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f); + int added = _mesa_symbol_table_add_global_symbol(table, -1, f->name, entry); + assert(added == 0); +} + ir_variable *glsl_symbol_table::get_variable(const char *name) { symbol_table_entry *entry = get_entry(name); |