diff options
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r-- | mesalib/src/glsl/ast_to_hir.cpp | 5 | ||||
-rw-r--r-- | mesalib/src/glsl/builtin_functions.cpp | 8 | ||||
-rw-r--r-- | mesalib/src/glsl/ir.h | 3 | ||||
-rw-r--r-- | mesalib/src/glsl/ir_print_visitor.cpp | 7 | ||||
-rw-r--r-- | mesalib/src/glsl/link_uniforms.cpp | 3 | ||||
-rw-r--r-- | mesalib/src/glsl/ralloc.h | 7 |
6 files changed, 19 insertions, 14 deletions
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index 7516c33e1..0128b3f4e 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -799,11 +799,10 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, "assignment to %s", non_lvalue_description); error_emitted = true; - } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->data.read_only) { + } else if (lhs_var != NULL && lhs_var->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", - lhs->variable_referenced()->name); + lhs_var->name); error_emitted = true; } else if (lhs->type->is_array() && !state->check_version(120, 300, &lhs_loc, diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp index 3991f9d8d..f9f06862e 100644 --- a/mesalib/src/glsl/builtin_functions.cpp +++ b/mesalib/src/glsl/builtin_functions.cpp @@ -62,11 +62,9 @@ #include "program/prog_instruction.h" #include <limits> -#define f(x) join(x) -#define join(x) x ## f -#define M_PIf f(M_PI) -#define M_PI_2f f(M_PI_2) -#define M_PI_4f f(M_PI_4) +#define M_PIf ((float) M_PI) +#define M_PI_2f ((float) M_PI_2) +#define M_PI_4f ((float) M_PI_4) using namespace ir_builder; diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h index 6c7c60a27..ef4a12d60 100644 --- a/mesalib/src/glsl/ir.h +++ b/mesalib/src/glsl/ir.h @@ -2348,6 +2348,9 @@ extern "C" { extern void _mesa_print_ir(FILE *f, struct exec_list *instructions, struct _mesa_glsl_parse_state *state); +extern void +fprint_ir(FILE *f, const void *instruction); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/mesalib/src/glsl/ir_print_visitor.cpp b/mesalib/src/glsl/ir_print_visitor.cpp index 6f370b971..0a7695ae1 100644 --- a/mesalib/src/glsl/ir_print_visitor.cpp +++ b/mesalib/src/glsl/ir_print_visitor.cpp @@ -76,6 +76,13 @@ _mesa_print_ir(FILE *f, exec_list *instructions, fprintf(f, "\n)"); } +void +fprint_ir(FILE *f, const void *instruction) +{ + const ir_instruction *ir = (const ir_instruction *)instruction; + ir->fprint(f); +} + } /* extern "C" */ ir_print_visitor::ir_print_visitor(FILE *f) diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp index 29dc0b196..c7147e0ee 100644 --- a/mesalib/src/glsl/link_uniforms.cpp +++ b/mesalib/src/glsl/link_uniforms.cpp @@ -308,8 +308,7 @@ private: */ const unsigned values = values_for_type(type); if (type->contains_sampler()) { - this->num_shader_samplers += - type->is_array() ? type->array_size() : 1; + this->num_shader_samplers += values; } else if (type->contains_image()) { this->num_shader_images += values; diff --git a/mesalib/src/glsl/ralloc.h b/mesalib/src/glsl/ralloc.h index 4581a7a4e..1fe53573f 100644 --- a/mesalib/src/glsl/ralloc.h +++ b/mesalib/src/glsl/ralloc.h @@ -38,10 +38,9 @@ * Tridgell's talloc, but ralloc is an independent implementation * released under the MIT license and tuned for Mesa. * - * The talloc implementation is available under the GNU Lesser - * General Public License (GNU LGPL), version 3 or later. It is - * more sophisticated than ralloc in that it includes reference - * counting and debugging features. See: http://talloc.samba.org/ + * talloc is more sophisticated than ralloc in that it includes reference + * counting and useful debugging features. However, it is released under + * a non-permissive open source license. */ #ifndef RALLOC_H |