diff options
author | marha <marha@users.sourceforge.net> | 2013-09-18 08:03:04 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-09-18 08:03:04 +0200 |
commit | 7f669a708bd35bdf8e842f762ec68f9ad0ec0486 (patch) | |
tree | 332fc6d6e6f70503d717249e4e387bf3eea29637 /mesalib/src/glsl/ir.cpp | |
parent | a7d3f63ee5e292379ed6d6eba0c65512205a4786 (diff) | |
download | vcxsrv-7f669a708bd35bdf8e842f762ec68f9ad0ec0486.tar.gz vcxsrv-7f669a708bd35bdf8e842f762ec68f9ad0ec0486.tar.bz2 vcxsrv-7f669a708bd35bdf8e842f762ec68f9ad0ec0486.zip |
libX11 mesa pixman xserver git update 18 Sep 2013
xserver commit 8010d3a48bd0b224dcb0883e39c2351ad364d846
libX11 commit 5dcb40f28d59587597d2ff6e6ac64c71cfe6ff7b
pixman commit 58a79dfe6d1fd62c2b66c69fdb64f6b8ecf61da5
mesa commit a3b51a22f71819236baa6bbda9d0d050914b149d
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; } } |