aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-25 09:59:33 +0200
committermarha <marha@users.sourceforge.net>2012-10-25 09:59:33 +0200
commit281f26a1dfda732687680a36857960f74608df5b (patch)
tree2dada31e73b6e8a6d4e1202999a88377d0eebbf3 /mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
parent34d741a3fc96c9424ffec29b114a1bdfde40f8b0 (diff)
downloadvcxsrv-281f26a1dfda732687680a36857960f74608df5b.tar.gz
vcxsrv-281f26a1dfda732687680a36857960f74608df5b.tar.bz2
vcxsrv-281f26a1dfda732687680a36857960f74608df5b.zip
fontconfig mesa pixman git update
fonconfig: 73ab254336100c5971e3a1e14b73222efd0e9822 mesa: 86cd77d0a9ac940c2c06eebc5e9ef840d176712a pixman: 9df645dfb04b5a790faabe1e9a84fc37287d91b0
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp')
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp21
1 files changed, 19 insertions, 2 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 705f2b055..14b72dc80 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -630,6 +630,11 @@ 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)
@@ -1071,8 +1076,12 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir)
assert(index == storage->index + (int)i);
}
} else {
- st_src_reg src(PROGRAM_STATE_VAR, index,
- native_integers ? ir->type->base_type : GLSL_TYPE_FLOAT);
+ /* 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);
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. */
@@ -2039,6 +2048,9 @@ 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;
}
@@ -2064,6 +2076,7 @@ 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;
}
/**
@@ -2283,6 +2296,10 @@ 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++;