From: Andreas Boll Date: Mon, 29 Oct 2012 11:21:07 +0000 (+0100) Subject: Revert "glsl_to_tgsi: set correct register type for array and structure elements" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00e6819e9964458395c597b9b1745a913c5c889b;p=mesa.git Revert "glsl_to_tgsi: set correct register type for array and structure elements" This reverts commit ebd8df7a3152e34805e2863c8471ee1a2de38fe1. accidentally pushed. --- diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 14b72dc8006..705f2b055af 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -630,11 +630,6 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op, { int type = GLSL_TYPE_FLOAT; - assert(src0.type != GLSL_TYPE_ARRAY); - assert(src0.type != GLSL_TYPE_STRUCT); - assert(src1.type != GLSL_TYPE_ARRAY); - assert(src1.type != GLSL_TYPE_STRUCT); - if (src0.type == GLSL_TYPE_FLOAT || src1.type == GLSL_TYPE_FLOAT) type = GLSL_TYPE_FLOAT; else if (native_integers) @@ -1076,12 +1071,8 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir) assert(index == storage->index + (int)i); } } else { - /* We use GLSL_TYPE_FLOAT here regardless of the actual type of - * the data being moved since MOV does not care about the type of - * data it is moving, and we don't want to declare registers with - * array or struct types. - */ - st_src_reg src(PROGRAM_STATE_VAR, index, GLSL_TYPE_FLOAT); + st_src_reg src(PROGRAM_STATE_VAR, index, + native_integers ? ir->type->base_type : GLSL_TYPE_FLOAT); src.swizzle = slots[i].swizzle; emit(ir, TGSI_OPCODE_MOV, dst, src); /* even a float takes up a whole vec4 reg in a struct/array. */ @@ -2048,9 +2039,6 @@ glsl_to_tgsi_visitor::visit(ir_dereference_array *ir) else src.swizzle = SWIZZLE_NOOP; - /* Change the register type to the element type of the array. */ - src.type = ir->type->base_type; - this->result = src; } @@ -2076,7 +2064,6 @@ glsl_to_tgsi_visitor::visit(ir_dereference_record *ir) this->result.swizzle = SWIZZLE_NOOP; this->result.index += offset; - this->result.type = ir->type->base_type; } /** @@ -2296,10 +2283,6 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir) 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++;