glsl: Extend ir_expression_operation for ARB_shading_language_packing

For each function {pack,unpack}{Snorm,Unorm}4x8, add a corresponding
opcode to enum ir_expression_operation. Validate the new opcodes in
ir_validate.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Matt Turner
2013-01-21 14:12:37 -08:00
parent b0239ce960
commit b64b174b0a
4 changed files with 31 additions and 0 deletions

View File

@@ -336,6 +336,12 @@ ir_validate::visit_leave(ir_expression *ir)
assert(ir->operands[0]->type == glsl_type::vec2_type);
break;
case ir_unop_pack_snorm_4x8:
case ir_unop_pack_unorm_4x8:
assert(ir->type == glsl_type::uint_type);
assert(ir->operands[0]->type == glsl_type::vec4_type);
break;
case ir_unop_unpack_snorm_2x16:
case ir_unop_unpack_unorm_2x16:
case ir_unop_unpack_half_2x16:
@@ -343,6 +349,12 @@ ir_validate::visit_leave(ir_expression *ir)
assert(ir->operands[0]->type == glsl_type::uint_type);
break;
case ir_unop_unpack_snorm_4x8:
case ir_unop_unpack_unorm_4x8:
assert(ir->type == glsl_type::vec4_type);
assert(ir->operands[0]->type == glsl_type::uint_type);
break;
case ir_unop_unpack_half_2x16_split_x:
case ir_unop_unpack_half_2x16_split_y:
assert(ir->type == glsl_type::float_type);