diff options
Diffstat (limited to 'mesalib/src/glsl/ir_validate.cpp')
-rw-r--r-- | mesalib/src/glsl/ir_validate.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp index 97a581dc2..5a6f8bbf5 100644 --- a/mesalib/src/glsl/ir_validate.cpp +++ b/mesalib/src/glsl/ir_validate.cpp @@ -654,7 +654,7 @@ ir_validate::visit(ir_variable *ir) * in the ir_dereference_variable handler to ensure that a variable is * declared before it is dereferenced. */ - if (ir->name) + if (ir->name && ir->is_name_ralloced()) assert(ralloc_parent(ir->name) == ir); hash_table_insert(ht, ir, ir); @@ -682,10 +682,15 @@ ir_validate::visit(ir_variable *ir) ir->get_interface_type()->fields.structure; for (unsigned i = 0; i < ir->get_interface_type()->length; i++) { if (fields[i].type->array_size() > 0) { - if (ir->max_ifc_array_access[i] >= fields[i].type->length) { + const unsigned *const max_ifc_array_access = + ir->get_max_ifc_array_access(); + + assert(max_ifc_array_access != NULL); + + if (max_ifc_array_access[i] >= fields[i].type->length) { printf("ir_variable has maximum access out of bounds for " "field %s (%d vs %d)\n", fields[i].name, - ir->max_ifc_array_access[i], fields[i].type->length); + max_ifc_array_access[i], fields[i].type->length); ir->print(); abort(); } @@ -700,6 +705,14 @@ ir_validate::visit(ir_variable *ir) abort(); } + if (ir->data.mode == ir_var_uniform + && strncmp(ir->name, "gl_", 3) == 0 + && ir->get_state_slots() == NULL) { + printf("built-in uniform has no state\n"); + ir->print(); + abort(); + } + return visit_continue; } |