diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2013-03-12 12:42:51 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-05-13 12:05:18 -0700 |
commit | dafd6918f305274c8374bf9d427d90a3dabe13cb (patch) | |
tree | ffedaac8613427a35f801b23cc8865583655a130 /src/glsl/ir_validate.cpp | |
parent | f274a2ca8733059bdd4f1c456ed4f6df7d7ec008 (diff) | |
download | external_mesa3d-dafd6918f305274c8374bf9d427d90a3dabe13cb.zip external_mesa3d-dafd6918f305274c8374bf9d427d90a3dabe13cb.tar.gz external_mesa3d-dafd6918f305274c8374bf9d427d90a3dabe13cb.tar.bz2 |
glsl: Add ir_triop_vector_insert
The new opcode is used to generate a new vector with a single field from
the source vector replaced. This will eventually replace
ir_dereference_array of vectors in the LHS of assignments.
v2: Convert tabs to spaces. Suggested by Eric.
v3: Add constant expression handling for ir_triop_vector_insert. This
prevents the constant matrix inversion tests from regressing. Duh.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r-- | src/glsl/ir_validate.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 03480cc..5db2576 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -511,6 +511,15 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[2]->type == glsl_type::int_type); break; + case ir_triop_vector_insert: + assert(ir->operands[0]->type->is_vector()); + assert(ir->operands[1]->type->is_scalar()); + assert(ir->operands[0]->type->base_type == ir->operands[1]->type->base_type); + assert(ir->operands[2]->type->is_scalar() + && ir->operands[2]->type->is_integer()); + assert(ir->type == ir->operands[0]->type); + break; + case ir_quadop_bitfield_insert: assert(ir->operands[0]->type == ir->type); assert(ir->operands[1]->type == ir->type); |