i965: Support OPCODE_TRUNC in the brw_wm_fp.c code.

This gets two more glean glsl1 tests using the non-GLSL path.
This commit is contained in:
Eric Anholt 2009-05-28 10:34:08 -07:00
parent 9f6ec50f8c
commit 0ab8e2622e
3 changed files with 18 additions and 1 deletions

View file

@ -353,6 +353,19 @@ static void emit_mad( struct brw_compile *p,
}
}
static void emit_trunc( struct brw_compile *p,
const struct brw_reg *dst,
GLuint mask,
const struct brw_reg *arg0)
{
GLuint i;
for (i = 0; i < 4; i++) {
if (mask & (1<<i)) {
brw_RNDZ(p, dst[i], arg0[i]);
}
}
}
static void emit_lrp( struct brw_compile *p,
const struct brw_reg *dst,
@ -1224,6 +1237,10 @@ void brw_wm_emit( struct brw_wm_compile *c )
emit_dph(p, dst, dst_flags, args[0], args[1]);
break;
case OPCODE_TRUNC:
emit_trunc(p, dst, dst_flags, args[0]);
break;
case OPCODE_LRP:
emit_lrp(p, dst, dst_flags, args[0], args[1], args[2]);
break;

View file

@ -23,7 +23,6 @@ GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp)
const struct prog_instruction *inst = &fp->Base.Instructions[i];
switch (inst->Opcode) {
case OPCODE_IF:
case OPCODE_TRUNC:
case OPCODE_ENDIF:
case OPCODE_CAL:
case OPCODE_BRK:

View file

@ -159,6 +159,7 @@ void brw_wm_pass1( struct brw_wm_compile *c )
case OPCODE_FRC:
case OPCODE_MOV:
case OPCODE_SWZ:
case OPCODE_TRUNC:
read0 = writemask;
break;