void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, GLboolean allocate, GLboolean eot, GLuint header) { struct brw_compile *p = &c->func; GLuint start = c->last_mrf; brw_clip_ff_sync(c); assert(!(allocate && eot)); /* Cycle through mrf regs - probably futile as we have to wait for * the allocation response anyway. Also, the order this function * is invoked doesn't correspond to the order the instructions will * be executed, so it won't have any effect in many cases. */ #if 0 if (start + c->nr_regs + 1 >= MAX_MRF) start = 0; c->last_mrf = start + c->nr_regs + 1; #endif /* Copy the vertex from vertn into m1..mN+1: */ brw_copy_from_indirect(p, brw_message_reg(start+1), vert, c->nr_regs); /* Overwrite PrimType and PrimStart in the message header, for * each vertex in turn: */ brw_MOV(p, get_element_ud(c->reg.R0, 2), brw_imm_ud(header)); /* Send each vertex as a seperate write to the urb. This * is different to the concept in brw_sf_emit.c, where * subsequent writes are used to build up a single urb * entry. Each of these writes instantiates a seperate * urb entry - (I think... what about 'allocate'?) */ brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), start, c->reg.R0, allocate, 1, /* used */ c->nr_regs + 1, /* msg length */ allocate ? 1 : 0, /* response_length */ eot, /* eot */ 1, /* writes_complete */ 0, /* urb offset */ BRW_URB_SWIZZLE_NONE); }
void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, enum brw_urb_write_flags flags, GLuint header) { struct brw_codegen *p = &c->func; bool allocate = flags & BRW_URB_WRITE_ALLOCATE; brw_clip_ff_sync(c); /* 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: */ brw_copy_from_indirect(p, brw_message_reg(1), vert, c->nr_regs); /* Overwrite PrimType and PrimStart in the message header, for * each vertex in turn: */ brw_MOV(p, get_element_ud(c->reg.R0, 2), brw_imm_ud(header)); /* Send each vertex as a separate write to the urb. This * is different to the concept in brw_sf_emit.c, where * subsequent writes are used to build up a single urb * entry. Each of these writes instantiates a separate * urb entry - (I think... what about 'allocate'?) */ brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, c->reg.R0, flags, c->nr_regs + 1, /* msg length */ allocate ? 1 : 0, /* response_length */ 0, /* urb offset */ BRW_URB_SWIZZLE_NONE); }
void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, bool allocate, bool eot, GLuint header) { struct brw_compile *p = &c->func; brw_clip_ff_sync(c); assert(!(allocate && eot)); /* Copy the vertex from vertn into m1..mN+1: */ brw_copy_from_indirect(p, brw_message_reg(1), vert, c->nr_regs); /* Overwrite PrimType and PrimStart in the message header, for * each vertex in turn: */ brw_MOV(p, get_element_ud(c->reg.R0, 2), brw_imm_ud(header)); /* Send each vertex as a seperate write to the urb. This * is different to the concept in brw_sf_emit.c, where * subsequent writes are used to build up a single urb * entry. Each of these writes instantiates a seperate * urb entry - (I think... what about 'allocate'?) */ brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, c->reg.R0, allocate, 1, /* used */ c->nr_regs + 1, /* msg length */ allocate ? 1 : 0, /* response_length */ eot, /* eot */ 1, /* writes_complete */ 0, /* urb offset */ BRW_URB_SWIZZLE_NONE); }