aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-28 09:11:07 +0200
committermarha <marha@users.sourceforge.net>2012-03-28 09:11:07 +0200
commit9b51c6da8bffdd67353b1e1245698a7eac478481 (patch)
treecde44c263cb1756fae5b4a83facb3c0cdfa474e4 /mesalib/src/glsl/ir.cpp
parentfb2b04331b6ae2cd11f6132cf16f6fcd848fb6b8 (diff)
parentec617f09d07e32d6f57c0da133f53ad3d43a568a (diff)
downloadvcxsrv-9b51c6da8bffdd67353b1e1245698a7eac478481.tar.gz
vcxsrv-9b51c6da8bffdd67353b1e1245698a7eac478481.tar.bz2
vcxsrv-9b51c6da8bffdd67353b1e1245698a7eac478481.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl/ir.cpp')
-rw-r--r--mesalib/src/glsl/ir.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp
index a5eca5a51..3c9d6e174 100644
--- a/mesalib/src/glsl/ir.cpp
+++ b/mesalib/src/glsl/ir.cpp
@@ -1026,9 +1026,11 @@ ir_loop::ir_loop()
ir_dereference_variable::ir_dereference_variable(ir_variable *var)
{
+ assert(var != NULL);
+
this->ir_type = ir_type_dereference_variable;
this->var = var;
- this->type = (var != NULL) ? var->type : glsl_type::error_type;
+ this->type = var->type;
}
@@ -1055,19 +1057,18 @@ ir_dereference_array::ir_dereference_array(ir_variable *var,
void
ir_dereference_array::set_array(ir_rvalue *value)
{
+ assert(value != NULL);
+
this->array = value;
- this->type = glsl_type::error_type;
- if (this->array != NULL) {
- const glsl_type *const vt = this->array->type;
+ const glsl_type *const vt = this->array->type;
- if (vt->is_array()) {
- type = vt->element_type();
- } else if (vt->is_matrix()) {
- type = vt->column_type();
- } else if (vt->is_vector()) {
- type = vt->get_base_type();
- }
+ if (vt->is_array()) {
+ type = vt->element_type();
+ } else if (vt->is_matrix()) {
+ type = vt->column_type();
+ } else if (vt->is_vector()) {
+ type = vt->get_base_type();
}
}
@@ -1075,11 +1076,12 @@ ir_dereference_array::set_array(ir_rvalue *value)
ir_dereference_record::ir_dereference_record(ir_rvalue *value,
const char *field)
{
+ assert(value != NULL);
+
this->ir_type = ir_type_dereference_record;
this->record = value;
this->field = ralloc_strdup(this, field);
- this->type = (this->record != NULL)
- ? this->record->type->field_type(field) : glsl_type::error_type;
+ this->type = this->record->type->field_type(field);
}
@@ -1091,8 +1093,7 @@ ir_dereference_record::ir_dereference_record(ir_variable *var,
this->ir_type = ir_type_dereference_record;
this->record = new(ctx) ir_dereference_variable(var);
this->field = ralloc_strdup(this, field);
- this->type = (this->record != NULL)
- ? this->record->type->field_type(field) : glsl_type::error_type;
+ this->type = this->record->type->field_type(field);
}
bool