void brw_clip_emit_vue(struct brw_clip_compile *c,
struct brw_indirect vert,
- bool allocate,
- bool eot,
+ enum brw_urb_write_flags flags,
GLuint header)
{
struct brw_compile *p = &c->func;
+ bool allocate = flags & BRW_URB_WRITE_ALLOCATE;
brw_clip_ff_sync(c);
- assert(!(allocate && eot));
+ /* Any URB entry that is allocated must subsequently be used or discarded,
+ * so it doesn't make sense to mark EOT and ALLOCATE at the same time.
+ */
+ assert(!(allocate && (flags & BRW_URB_WRITE_EOT)));
/* Copy the vertex from vertn into m1..mN+1:
*/
allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD),
0,
c->reg.R0,
- allocate,
- 1, /* used */
+ flags,
c->nr_regs + 1, /* msg length */
allocate ? 1 : 0, /* response_length */
- eot, /* eot */
- 1, /* writes_complete */
0, /* urb offset */
BRW_URB_SWIZZLE_NONE);
}
retype(brw_null_reg(), BRW_REGISTER_TYPE_UD),
0,
c->reg.R0,
- 0, /* allocate */
- 0, /* used */
+ BRW_URB_WRITE_UNUSED | BRW_URB_WRITE_EOT_COMPLETE,
1, /* msg len */
0, /* response len */
- 1, /* eot */
- 1, /* writes complete */
0,
BRW_URB_SWIZZLE_NONE);
}
{
struct brw_compile *p = &c->func;
struct brw_reg incoming = get_element_ud(c->reg.R0, 2);
+ struct brw_context *brw = p->brw;
/* Shift so that lowest outcode bit is rightmost:
*/
/* Rearrange userclip outcodes so that they come directly after
* the fixed plane bits.
*/
- brw_AND(p, tmp, incoming, brw_imm_ud(0x3f<<14));
+ if (brw->gen == 5 || brw->is_g4x)
+ brw_AND(p, tmp, incoming, brw_imm_ud(0xff<<14));
+ else
+ brw_AND(p, tmp, incoming, brw_imm_ud(0x3f<<14));
+
brw_SHR(p, tmp, tmp, brw_imm_ud(8));
brw_OR(p, c->reg.planemask, c->reg.planemask, tmp);