aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-28 07:55:57 +0100
committermarha <marha@users.sourceforge.net>2013-01-28 07:55:57 +0100
commit69c8cec54b01ed522bf10baf20da70304bac701a (patch)
treef37ea158a90ecb99d0780dfdaca14d05394fed3f /mesalib/src/glsl/ir.cpp
parent06872e284da1c00ce03b234ca24aefeac64990d2 (diff)
downloadvcxsrv-69c8cec54b01ed522bf10baf20da70304bac701a.tar.gz
vcxsrv-69c8cec54b01ed522bf10baf20da70304bac701a.tar.bz2
vcxsrv-69c8cec54b01ed522bf10baf20da70304bac701a.zip
mesa mkfontscale pixman git update 28 jan 2013
mesa: 87592cff57feef29565150b9203e220b50623f30 mkfontscale: b3af8de8d25128f565c2ed2f7c63b6e4099eb84e pixman: 65fc1adb6545737058e938105ae948a3607c277c
Diffstat (limited to 'mesalib/src/glsl/ir.cpp')
-rw-r--r--mesalib/src/glsl/ir.cpp52
1 files changed, 47 insertions, 5 deletions
diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp
index 703f5ec58..954995db3 100644
--- a/mesalib/src/glsl/ir.cpp
+++ b/mesalib/src/glsl/ir.cpp
@@ -306,6 +306,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
break;
case ir_unop_noise:
+ case ir_unop_unpack_half_2x16_split_x:
+ case ir_unop_unpack_half_2x16_split_y:
this->type = glsl_type::float_type;
break;
@@ -313,6 +315,25 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
this->type = glsl_type::bool_type;
break;
+ case ir_unop_pack_snorm_2x16:
+ case ir_unop_pack_snorm_4x8:
+ case ir_unop_pack_unorm_2x16:
+ case ir_unop_pack_unorm_4x8:
+ case ir_unop_pack_half_2x16:
+ this->type = glsl_type::uint_type;
+ break;
+
+ case ir_unop_unpack_snorm_2x16:
+ case ir_unop_unpack_unorm_2x16:
+ case ir_unop_unpack_half_2x16:
+ this->type = glsl_type::vec2_type;
+ break;
+
+ case ir_unop_unpack_snorm_4x8:
+ case ir_unop_unpack_unorm_4x8:
+ this->type = glsl_type::vec4_type;
+ break;
+
default:
assert(!"not reached: missing automatic type setup for ir_expression");
this->type = op0->type;
@@ -364,10 +385,15 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
case ir_binop_bit_and:
case ir_binop_bit_xor:
case ir_binop_bit_or:
+ assert(!op0->type->is_matrix());
+ assert(!op1->type->is_matrix());
if (op0->type->is_scalar()) {
- this->type = op1->type;
+ this->type = op1->type;
} else if (op1->type->is_scalar()) {
- this->type = op0->type;
+ this->type = op0->type;
+ } else {
+ assert(op0->type->vector_elements == op1->type->vector_elements);
+ this->type = op0->type;
}
break;
@@ -386,6 +412,10 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
this->type = glsl_type::float_type;
break;
+ case ir_binop_pack_half_2x16_split:
+ this->type = glsl_type::uint_type;
+ break;
+
case ir_binop_lshift:
case ir_binop_rshift:
this->type = op0->type;
@@ -454,6 +484,18 @@ static const char *const operator_strs[] = {
"cos_reduced",
"dFdx",
"dFdy",
+ "packSnorm2x16",
+ "packSnorm4x8",
+ "packUnorm2x16",
+ "packUnorm4x8",
+ "packHalf2x16",
+ "unpackSnorm2x16",
+ "unpackSnorm4x8",
+ "unpackUnorm2x16",
+ "unpackUnorm4x8",
+ "unpackHalf2x16",
+ "unpackHalf2x16_split_x",
+ "unpackHalf2x16_split_y",
"noise",
"+",
"-",
@@ -480,6 +522,7 @@ static const char *const operator_strs[] = {
"min",
"max",
"pow",
+ "packHalf2x16_split",
"ubo_load",
"vector",
};
@@ -1493,7 +1536,6 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->has_initializer = false;
this->location = -1;
this->location_frac = 0;
- this->uniform_block = -1;
this->warn_extension = NULL;
this->constant_value = NULL;
this->constant_initializer = NULL;
@@ -1553,8 +1595,8 @@ modes_match(unsigned a, unsigned b)
return true;
/* Accept "in" vs. "const in" */
- if ((a == ir_var_const_in && b == ir_var_in) ||
- (b == ir_var_const_in && a == ir_var_in))
+ if ((a == ir_var_const_in && b == ir_var_function_in) ||
+ (b == ir_var_const_in && a == ir_var_function_in))
return true;
return false;