i965: Fix Crystal Well PCI IDs.
[mesa.git] / src / mesa / program / ir_to_mesa.cpp
index fc892fe86cc8d2d20a0f4b4e27eb71fcf8bcd7f1..486cf4639cef4fa901dfe7ca9a0b492ce696a199 100644 (file)
@@ -625,6 +625,7 @@ type_size(const struct glsl_type *type)
       return 1;
    case GLSL_TYPE_VOID:
    case GLSL_TYPE_ERROR:
+   case GLSL_TYPE_INTERFACE:
       assert(!"Invalid type in type_size");
       break;
    }
@@ -1431,10 +1432,14 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       emit(ir, OPCODE_FRC, result_dst, op[0]);
       break;
    case ir_unop_pack_snorm_2x16:
+   case ir_unop_pack_snorm_4x8:
    case ir_unop_pack_unorm_2x16:
+   case ir_unop_pack_unorm_4x8:
    case ir_unop_pack_half_2x16:
    case ir_unop_unpack_snorm_2x16:
+   case ir_unop_unpack_snorm_4x8:
    case ir_unop_unpack_unorm_2x16:
+   case ir_unop_unpack_unorm_4x8:
    case ir_unop_unpack_half_2x16:
    case ir_unop_unpack_half_2x16_split_x:
    case ir_unop_unpack_half_2x16_split_y:
@@ -1473,6 +1478,13 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       assert(!"not supported");
       break;
 
+   case ir_triop_lrp:
+      /* ir_triop_lrp operands are (x, y, a) while
+       * OPCODE_LRP operands are (a, y, x) to match ARB_fragment_program.
+       */
+      emit(ir, OPCODE_LRP, result_dst, op[2], op[1], op[0]);
+      break;
+
    case ir_quadop_vector:
       /* This operation should have already been handled.
        */
@@ -2033,6 +2045,9 @@ ir_to_mesa_visitor::visit(ir_texture *ir)
       ir->lod_info.grad.dPdy->accept(this);
       dy = this->result;
       break;
+   case ir_txf_ms:
+      assert(!"Unexpected ir_txf_ms opcode");
+      break;
    }
 
    const glsl_type *sampler_type = ir->sampler->type;
@@ -2370,7 +2385,7 @@ print_program(struct prog_instruction *mesa_instructions,
    }
 }
 
-class add_uniform_to_shader : public uniform_field_visitor {
+class add_uniform_to_shader : public program_resource_visitor {
 public:
    add_uniform_to_shader(struct gl_shader_program *shader_program,
                         struct gl_program_parameter_list *params)
@@ -2382,13 +2397,14 @@ public:
    void process(ir_variable *var)
    {
       this->idx = -1;
-      this->uniform_field_visitor::process(var);
+      this->program_resource_visitor::process(var);
 
       var->location = this->idx;
    }
 
 private:
-   virtual void visit_field(const glsl_type *type, const char *name);
+   virtual void visit_field(const glsl_type *type, const char *name,
+                            bool row_major);
 
    struct gl_shader_program *shader_program;
    struct gl_program_parameter_list *params;
@@ -2396,10 +2412,13 @@ private:
 };
 
 void
-add_uniform_to_shader::visit_field(const glsl_type *type, const char *name)
+add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
+                                   bool row_major)
 {
    unsigned int size;
 
+   (void) row_major;
+
    if (type->is_vector() || type->is_scalar()) {
       size = type->vector_elements;
    } else {
@@ -2469,7 +2488,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
       ir_variable *var = ((ir_instruction *) node)->as_variable();
 
       if ((var == NULL) || (var->mode != ir_var_uniform)
-         || var->uniform_block != -1 || (strncmp(var->name, "gl_", 3) == 0))
+         || var->is_in_uniform_block() || (strncmp(var->name, "gl_", 3) == 0))
         continue;
 
       add.process(var);
@@ -2536,6 +2555,7 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
          case GLSL_TYPE_VOID:
          case GLSL_TYPE_STRUCT:
          case GLSL_TYPE_ERROR:
+         case GLSL_TYPE_INTERFACE:
            assert(!"Should not get here.");
            break;
         }