ir_to_mesa: remove unused 'target' variable
[mesa.git] / src / mesa / program / ir_to_mesa.cpp
index 49e4a7a40eb0c6bc618af73e5feafd746958ee47..5196545b8ae24a4615d1c12635ddc24ad5ff22aa 100644 (file)
@@ -682,8 +682,8 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
 
    if (ir->data.mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) {
       unsigned int i;
-      const ir_state_slot *const slots = ir->state_slots;
-      assert(ir->state_slots != NULL);
+      const ir_state_slot *const slots = ir->get_state_slots();
+      assert(slots != NULL);
 
       /* Check if this statevar's setup in the STATE file exactly
        * matches how we'll want to reference it as a
@@ -691,7 +691,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
        * temporary storage and hope that it'll get copy-propagated
        * out.
        */
-      for (i = 0; i < ir->num_state_slots; i++) {
+      for (i = 0; i < ir->get_num_state_slots(); i++) {
         if (slots[i].swizzle != SWIZZLE_XYZW) {
            break;
         }
@@ -699,7 +699,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
 
       variable_storage *storage;
       dst_reg dst;
-      if (i == ir->num_state_slots) {
+      if (i == ir->get_num_state_slots()) {
         /* We'll set the index later. */
         storage = new(mem_ctx) variable_storage(ir, PROGRAM_STATE_VAR, -1);
         this->variables.push_tail(storage);
@@ -710,7 +710,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
          * of the type.  However, this had better match the number of state
          * elements that we're going to copy into the new temporary.
          */
-        assert((int) ir->num_state_slots == type_size(ir->type));
+        assert((int) ir->get_num_state_slots() == type_size(ir->type));
 
         storage = new(mem_ctx) variable_storage(ir, PROGRAM_TEMPORARY,
                                                 this->next_temp);
@@ -721,7 +721,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
       }
 
 
-      for (unsigned int i = 0; i < ir->num_state_slots; i++) {
+      for (unsigned int i = 0; i < ir->get_num_state_slots(); i++) {
         int index = _mesa_add_state_reference(this->prog->Parameters,
                                               (gl_state_index *)slots[i].tokens);
 
@@ -741,7 +741,7 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
       }
 
       if (storage->file == PROGRAM_TEMPORARY &&
-         dst.index != storage->index + (int) ir->num_state_slots) {
+         dst.index != storage->index + (int) ir->get_num_state_slots()) {
         linker_error(this->shader_program,
                      "failed to load builtin uniform `%s' "
                      "(%d/%d regs loaded)\n",
@@ -2505,12 +2505,7 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
            columns = storage->type->matrix_columns;
            break;
         case GLSL_TYPE_BOOL:
-           if (ctx->Const.NativeIntegers) {
-              format = (ctx->Const.UniformBooleanTrue == 1)
-                 ? uniform_bool_int_0_1 : uniform_bool_int_0_not0;
-           } else {
-              format = uniform_bool_float;
-           }
+           format = uniform_native;
            columns = 1;
            break;
         case GLSL_TYPE_SAMPLER:
@@ -2948,12 +2943,9 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
 
         /* Lowering */
         do_mat_op_to_vec(ir);
-        GLenum target = _mesa_shader_stage_to_program(prog->_LinkedShaders[i]->Stage);
         lower_instructions(ir, (MOD_TO_FRACT | DIV_TO_MUL_RCP | EXP_TO_EXP2
                                 | LOG_TO_LOG2 | INT_DIV_TO_MUL_RCP
-                                | ((options->EmitNoPow) ? POW_TO_EXP2 : 0)
-                                | ((target == GL_VERTEX_PROGRAM_ARB) ? SAT_TO_CLAMP
-                                    : 0)));
+                                | ((options->EmitNoPow) ? POW_TO_EXP2 : 0)));
 
         progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
 
@@ -3025,7 +3017,7 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
 {
    unsigned int i;
 
-   _mesa_clear_shader_program_data(ctx, prog);
+   _mesa_clear_shader_program_data(prog);
 
    prog->LinkStatus = GL_TRUE;