~ubuntu-branches/ubuntu/raring/mesa/raring

« back to all changes in this revision

Viewing changes to src/mesa/state_tracker/st_glsl_to_tgsi.cpp

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2013-01-22 11:54:09 UTC
  • mfrom: (1.7.13)
  • Revision ID: package-import@ubuntu.com-20130122115409-5e9xii2ee1whab3e
Tags: 9.0.2-0ubuntu1
* New upstream release.
* Decrease size of mesa's libgl1-mesa-dri again
  - re-enable 117-static-gallium.patch
  - add 118-dricore-gallium.patch to link against libdricore again

Show diffs side-by-side

added added

removed removed

Lines of Context:
633
633
{
634
634
   int type = GLSL_TYPE_FLOAT;
635
635
   
 
636
   assert(src0.type != GLSL_TYPE_ARRAY);
 
637
   assert(src0.type != GLSL_TYPE_STRUCT);
 
638
   assert(src1.type != GLSL_TYPE_ARRAY);
 
639
   assert(src1.type != GLSL_TYPE_STRUCT);
 
640
 
636
641
   if (src0.type == GLSL_TYPE_FLOAT || src1.type == GLSL_TYPE_FLOAT)
637
642
      type = GLSL_TYPE_FLOAT;
638
643
   else if (native_integers)
1074
1079
               assert(index == storage->index + (int)i);
1075
1080
            }
1076
1081
         } else {
1077
 
            st_src_reg src(PROGRAM_STATE_VAR, index,
1078
 
                  native_integers ? ir->type->base_type : GLSL_TYPE_FLOAT);
 
1082
                /* We use GLSL_TYPE_FLOAT here regardless of the actual type of
 
1083
                 * the data being moved since MOV does not care about the type of
 
1084
                 * data it is moving, and we don't want to declare registers with
 
1085
                 * array or struct types.
 
1086
                 */
 
1087
            st_src_reg src(PROGRAM_STATE_VAR, index, GLSL_TYPE_FLOAT);
1079
1088
            src.swizzle = slots[i].swizzle;
1080
1089
            emit(ir, TGSI_OPCODE_MOV, dst, src);
1081
1090
            /* even a float takes up a whole vec4 reg in a struct/array. */
2042
2051
   else
2043
2052
      src.swizzle = SWIZZLE_NOOP;
2044
2053
 
 
2054
   /* Change the register type to the element type of the array. */
 
2055
   src.type = ir->type->base_type;
 
2056
 
2045
2057
   this->result = src;
2046
2058
}
2047
2059
 
2067
2079
      this->result.swizzle = SWIZZLE_NOOP;
2068
2080
 
2069
2081
   this->result.index += offset;
 
2082
   this->result.type = ir->type->base_type;
2070
2083
}
2071
2084
 
2072
2085
/**
2286
2299
      inst->dead_mask = inst->dst.writemask;
2287
2300
   } else {
2288
2301
      for (i = 0; i < type_size(ir->lhs->type); i++) {
 
2302
         if (ir->rhs->type->is_array())
 
2303
                r.type = ir->rhs->type->element_type()->base_type;
 
2304
         else if (ir->rhs->type->is_record())
 
2305
                r.type = ir->rhs->type->fields.structure[i].type->base_type;
2289
2306
         emit(ir, TGSI_OPCODE_MOV, l, r);
2290
2307
         l.index++;
2291
2308
         r.index++;
2577
2594
   /* Storage for our result.  Ideally for an assignment we'd be using
2578
2595
    * the actual storage for the result here, instead.
2579
2596
    */
2580
 
   result_src = get_temp(glsl_type::vec4_type);
 
2597
   result_src = get_temp(ir->type);
2581
2598
   result_dst = st_dst_reg(result_src);
2582
2599
 
2583
2600
   switch (ir->op) {