+static inline void
+load_vertex_pos(struct brw_clip_compile *c, struct brw_indirect vtx,
+ struct brw_reg dst,
+ GLuint hpos_offset, GLuint clip_offset)
+{
+ struct brw_compile *p = &c->func;
+
+ /*
+ * Roughly:
+ * dst = (vertex_src_mask & 1) ? src.hpos : src.clipvertex;
+ */
+
+ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ);
+ brw_AND(p, vec1(brw_null_reg()), c->reg.vertex_src_mask, brw_imm_ud(1));
+ brw_IF(p, BRW_EXECUTE_1);
+ {
+ brw_MOV(p, dst, deref_4f(vtx, clip_offset));
+ }
+ brw_ELSE(p);
+ {
+ brw_MOV(p, dst, deref_4f(vtx, hpos_offset));
+ }
+ brw_ENDIF(p);
+}
+