diff options
author | marha <marha@users.sourceforge.net> | 2012-12-12 08:35:50 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-12-12 08:35:50 +0100 |
commit | b395c3c85251d4e8761704d8e3a3c9f9fa5b45cc (patch) | |
tree | 9e522597a3553d72c66f4c9c57fc15c6c4df345c /mesalib/src/mesa/state_tracker | |
parent | 0328076efb5ff6e62152c09e38d0d11f7931d07b (diff) | |
download | vcxsrv-b395c3c85251d4e8761704d8e3a3c9f9fa5b45cc.tar.gz vcxsrv-b395c3c85251d4e8761704d8e3a3c9f9fa5b45cc.tar.bz2 vcxsrv-b395c3c85251d4e8761704d8e3a3c9f9fa5b45cc.zip |
fontconfig mesa pixman xkeyboard-config git update 12 dev 2012
fontconfig: 9ce36f4bbebc702a35d0cd9f1a59d5b828549bc6
mesa: 621259b3de1f15c879620bbf17764fd8a27ae6f5
pixman: fdab3c1b6cd9c5e197ec3f6bc0a03da32880e317
xkeyboard-config: 378597a9d525f069c049fdd6d04ff628123f82c7
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index a4df4e5fa..1d96e905c 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -442,6 +442,9 @@ public: void merge_registers(void); void renumber_registers(void); + void emit_block_mov(ir_assignment *ir, const struct glsl_type *type, + st_dst_reg *l, st_src_reg *r); + void *mem_ctx; }; @@ -2244,6 +2247,44 @@ glsl_to_tgsi_visitor::process_move_condition(ir_rvalue *ir) } void +glsl_to_tgsi_visitor::emit_block_mov(ir_assignment *ir, const struct glsl_type *type, + st_dst_reg *l, st_src_reg *r) +{ + if (type->base_type == GLSL_TYPE_STRUCT) { + for (unsigned int i = 0; i < type->length; i++) { + emit_block_mov(ir, type->fields.structure[i].type, l, r); + } + return; + } + + if (type->is_array()) { + for (unsigned int i = 0; i < type->length; i++) { + emit_block_mov(ir, type->fields.array, l, r); + } + return; + } + + if (type->is_matrix()) { + const struct glsl_type *vec_type; + + vec_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, + type->vector_elements, 1); + + for (int i = 0; i < type->matrix_columns; i++) { + emit_block_mov(ir, vec_type, l, r); + } + return; + } + + assert(type->is_scalar() || type->is_vector()); + + r->type = type->base_type; + emit(ir, TGSI_OPCODE_MOV, *l, *r); + l->index++; + r->index++; +} + +void glsl_to_tgsi_visitor::visit(ir_assignment *ir) { st_dst_reg l; @@ -2347,15 +2388,7 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir) new_inst->saturate = inst->saturate; inst->dead_mask = inst->dst.writemask; } else { - for (i = 0; i < type_size(ir->lhs->type); i++) { - if (ir->rhs->type->is_array()) - r.type = ir->rhs->type->element_type()->base_type; - else if (ir->rhs->type->is_record()) - r.type = ir->rhs->type->fields.structure[i].type->base_type; - emit(ir, TGSI_OPCODE_MOV, l, r); - l.index++; - r.index++; - } + emit_block_mov(ir, ir->rhs->type, &l, &r); } } |