Explorar el Código

ir_to_mesa: Implement neg expression.

tags/mesa-7.9-rc1
Eric Anholt hace 15 años
padre
commit
c45b615a37
Se han modificado 2 ficheros con 7 adiciones y 1 borrados
  1. 6
    1
      ir_to_mesa.cpp
  2. 1
    0
      ir_to_mesa.h

+ 6
- 1
ir_to_mesa.cpp Ver fichero

@@ -47,7 +47,7 @@ extern "C" {
}

ir_to_mesa_src_reg ir_to_mesa_undef = {
PROGRAM_UNDEFINED, 0, SWIZZLE_NOOP, false,
PROGRAM_UNDEFINED, 0, SWIZZLE_NOOP, NEGATE_NONE, false,
};

ir_to_mesa_dst_reg ir_to_mesa_undef_dst = {
@@ -184,6 +184,7 @@ ir_to_mesa_visitor::create_tree(int op,
tree->right = right;
tree->v = this;
tree->src_reg.swizzle = SWIZZLE_XYZW;
tree->src_reg.negate = 0;
tree->dst_reg.writemask = WRITEMASK_XYZW;
ir_to_mesa_set_tree_reg(tree, PROGRAM_UNDEFINED, 0);
tree->ir = ir;
@@ -418,6 +419,10 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
this->result = this->create_tree(MB_TERM_seq_vec4_vec4, ir,
op[0], this->result);
break;
case ir_unop_neg:
op[0]->src_reg.negate = ~op[0]->src_reg.negate;
this->result = op[0];
break;
case ir_unop_exp:
this->result = this->create_tree(MB_TERM_exp_vec4, ir, op[0], NULL);
break;

+ 1
- 0
ir_to_mesa.h Ver fichero

@@ -40,6 +40,7 @@ typedef struct ir_to_mesa_src_reg {
int file; /**< PROGRAM_* from Mesa */
int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
int swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
int negate; /**< NEGATE_XYZW mask from mesa */
bool reladdr; /**< Register index should be offset by address reg. */
} ir_to_mesa_src_reg;


Cargando…
Cancelar
Guardar