summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/ir.cpp b/ir.cpp
index c4c7584bcf..06eb19691e 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -57,9 +57,6 @@ ir_label::ir_label(const char *label)
ir_constant::ir_constant(const struct glsl_type *type, const void *data)
: ir_rvalue()
{
- const unsigned elements =
- ((type->vector_elements == 0) ? 1 : type->vector_elements)
- * ((type->matrix_columns == 0) ? 1 : type->matrix_columns);
unsigned size = 0;
this->type = type;
@@ -74,7 +71,7 @@ ir_constant::ir_constant(const struct glsl_type *type, const void *data)
break;
}
- memcpy(& this->value, data, size * elements);
+ memcpy(& this->value, data, size * type->components());
}