59
59
return (c->key.attrs & (1<<attr)) ? 1 : 0;
63
* Sets VERT_RESULT_FOGC.Y for gl_FrontFacing
65
* This is currently executed if the fragment program uses VERT_RESULT_FOGC
66
* at all, but this could be eliminated with a scan of the FP contents.
69
do_front_facing( struct brw_sf_compile *c )
71
struct brw_compile *p = &c->func;
74
if (!have_attr(c, VERT_RESULT_FOGC))
77
brw_push_insn_state(p);
78
brw_CMP(p, brw_null_reg(),
79
c->key.frontface_ccw ? BRW_CONDITIONAL_G : BRW_CONDITIONAL_L,
80
c->det, brw_imm_f(0));
81
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
82
for (i = 0; i < 3; i++) {
83
struct brw_reg fogc = get_vert_attr(c, c->vert[i],FRAG_ATTRIB_FOGC);
84
brw_MOV(p, get_element(fogc, 1), brw_imm_f(0));
85
brw_set_predicate_control(p, BRW_PREDICATE_NORMAL);
86
brw_MOV(p, get_element(fogc, 1), brw_imm_f(1));
87
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
89
brw_pop_insn_state(p);
93
62
/***********************************************************************