summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2012-11-19 10:48:25 -0800
committerChad Versace <[email protected]>2013-01-24 21:11:41 -0800
commitee5921ad0dfb11eebe666b03eab2ac1875c11280 (patch)
tree4695529a3ed11ceb1d65690b982c128b904f58d1 /src/glsl/ir.cpp
parent3a88d71d3558d756b0567efe4f22179d2606367c (diff)
glsl: Extend ir_expression_operation for GLSL 3.00 pack/unpack functions (v2)
For each function {pack,unpack}{Snorm,Unorm,Half}2x16, add a corresponding opcode to enum ir_expression_operation. Validate the new opcodes in ir_validate.cpp. Also, add opcodes for scalarized variants of the Half2x16 functions. (The code generator for the i965 fragment shader requires that all vector operations be scalarized. A lowering pass, to be added later, will scalarize the Half2x16 functions). v2: Fix assertion message in ir_to_mesa [for idr]. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Tuner <[email protected]> Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 75a9f24cf29..98e926d090a 100644
--- a/src/glsl/ir.cpp
+++ b/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,18 @@ 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_unorm_2x16:
+ 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;
+
default:
assert(!"not reached: missing automatic type setup for ir_expression");
this->type = op0->type;
@@ -386,6 +400,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 +472,14 @@ static const char *const operator_strs[] = {
"cos_reduced",
"dFdx",
"dFdy",
+ "packSnorm2x16",
+ "packUnorm2x16",
+ "packHalf2x16",
+ "unpackSnorm2x16",
+ "unpackUnorm2x16",
+ "unpackHalf2x16",
+ "unpackHalf2x16_split_x",
+ "unpackHalf2x16_split_y",
"noise",
"+",
"-",
@@ -480,6 +506,7 @@ static const char *const operator_strs[] = {
"min",
"max",
"pow",
+ "packHalf2x16_split",
"ubo_load",
"vector",
};