diff options
author | marha <marha@users.sourceforge.net> | 2013-09-18 08:09:44 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-09-18 08:09:44 +0200 |
commit | 09bfe74fc7d4a6f97eddb034df371e66e314ea12 (patch) | |
tree | b63caf666a8c36ddcc9a4202f7cecac49998e98d /mesalib/src/glsl/ir.cpp | |
parent | 5a54fa6e45ee10cf58ee1b6d2eb5522a24bb8745 (diff) | |
parent | 7f669a708bd35bdf8e842f762ec68f9ad0ec0486 (diff) | |
download | vcxsrv-09bfe74fc7d4a6f97eddb034df371e66e314ea12.tar.gz vcxsrv-09bfe74fc7d4a6f97eddb034df371e66e314ea12.tar.bz2 vcxsrv-09bfe74fc7d4a6f97eddb034df371e66e314ea12.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libX11 mesa pixman xserver git update 18 Sep 2013
Conflicts:
pixman/pixman/pixman-sse2.c
Diffstat (limited to 'mesalib/src/glsl/ir.cpp')
-rw-r--r-- | mesalib/src/glsl/ir.cpp | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp index 1b1799958..b0f92cb3f 100644 --- a/mesalib/src/glsl/ir.cpp +++ b/mesalib/src/glsl/ir.cpp @@ -401,6 +401,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) case ir_binop_lshift: case ir_binop_rshift: case ir_binop_bfm: + case ir_binop_ldexp: this->type = op0->type; break; @@ -551,6 +552,7 @@ static const char *const operator_strs[] = { "packHalf2x16_split", "bfm", "ubo_load", + "ldexp", "vector_extract", "fma", "lrp", @@ -617,42 +619,54 @@ ir_constant::ir_constant(const struct glsl_type *type, memcpy(& this->value, data, sizeof(this->value)); } -ir_constant::ir_constant(float f) +ir_constant::ir_constant(float f, unsigned vector_elements) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::float_type; - this->value.f[0] = f; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.f[i] = f; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.f[i] = 0; } } -ir_constant::ir_constant(unsigned int u) +ir_constant::ir_constant(unsigned int u, unsigned vector_elements) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::uint_type; - this->value.u[0] = u; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_UINT, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.u[i] = u; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.u[i] = 0; } } -ir_constant::ir_constant(int i) +ir_constant::ir_constant(int integer, unsigned vector_elements) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::int_type; - this->value.i[0] = i; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_INT, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.i[i] = integer; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.i[i] = 0; } } -ir_constant::ir_constant(bool b) +ir_constant::ir_constant(bool b, unsigned vector_elements) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::bool_type; - this->value.b[0] = b; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_BOOL, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.b[i] = b; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.b[i] = false; } } |